7. User Management and Permissions in Linux Flashcards
What is the command to see what user I’m currently logged in?
whoami
Do I need root access to the system in order to create new user? (Yes or No)
Yes
How to execute a command as the root user when logged in as a regular user?
with the prefix “sudo”
What are the command to add a new user?
useradd and adduser
What is the command to log as another user?
su (switch user)
What is the command to add a password to a user?
passwd [USER NAME]
What is the command to remove a user?
userdel
What is the command to add a user with home directory?
useradd -m
Where is the configuration file of the command useradd?
/etc/default/useradd
What is the command to see the shell we are currently using in sh shell?
$0
What is the command to switch user with a complete new session?
su - or su -l or –login
What is the command to remove a user and its home diretory?
userdel -r
Where are located the information about users?
/etc/passwd
How are the information displayed for each user in the passwd file?
user name : x : user id : group id : , , , : home directory : shell
Where is the default configuration file of adduser located?
/etc/adduser.conf