- while installing the VM, the installer would have prompted you to create 2 unique users, one was ROOT ,and other normal user
- When you log in to the VM for the first time, you always log in as normal user, and ROOT user is something you have to activate via the terminal.
- Being logged in as ROOT and performing mundane task is no advisable, hence the SUDO user exist.
- In order for a user to run SUDO, the user must belong to group=SUDO.
- if you give root an empty password during installation, SUDO will be installed and the first user will be able to use it to gain root access (currently, the user will be added to the SUDO group).
- If not, then normal user must log into the ROOT user and then create a SUDO user
- As a normal user id = username , you can enter ROOT profile by giving
command : su
It will then ask you for your ROOT password, after giving the correct password the prompt of the terminal will change
- Now you are logged in as ROOT, to confirm you can pass the command, # groups
and as output it would display root , and hence you are sure.
- As a ROOT you can either create a new user and add it to sudo group or add existing user to sudo group
- To create new user, use command,
The terminal will add a new user id : newusername and prompt you to create password and verify password
The terminal will then immediately create a home directory for the newusername and ask for other details like,
Fullname : Address: Home Ph: Office Ph: and prompt you if the info provided is correct ,
As soon as you verify the info is correct, you new user is created. To access this new user you must exit the ROOT terminal and exit session. The groups are allotted on at the time of session start, So log out and log in as newusername
- Once the new user is created we can assign it to SUDO group or can assign existing users to access SUDO group
- To give add user to SUDO group, log into ROOT user using ~$ su command and then give command
# adduser newusername sudo
- Once the terminal has added the newusername to SUDO group, it will say done.
- It is important to note, the user must log out completely and log in again, as the groups are assigned to users only on log in
- now as newusername when you give command ~$ groups it will give back result,
- this confirms newusername is now SUDO and thus it can create new user on behalf of the ROOT user.
- incase even after adding to the sudo group if the user does show sudo ifconfig , then it means, that you first need to install sudo on to the system before adding users to sudo group.
- To install sudo, log in to root user using su command, and then give command : apt-get install sudo
* make sure the iso of the debian is mounted
- After sudo is installed successfully, while still in root user, give command visudo
- In the visudo panel, in user privileges section, add your user name below root and give privileges ALL:ALL ALL
- Now exit root and as user give command sudo ifconfig , if the systems accepts your command, it confirms the sudo user is created.
When setting up a virtual machine as new workstation for yourself.