User & Group Management Flashcards
What command shows the current user?
whoami
Which command displays the user ID (UID) and group ID (GID)?
id
What command lists the groups the user belongs to?
groups
Fill in the blank: To create a new user with a home directory, use the command _______.
sudo useradd -m <username></username>
What command is used to change or set a user password?
sudo passwd <username></username>
Which command deletes a user?
sudo userdel <username></username>
What command creates a new group?
sudo groupadd <groupname></groupname>
Fill in the blank: To add a user to a group, use the command _______.
sudo usermod -aG <group> <user></user></group>
What command allows you to switch to another user?
su <username></username>
What command exits the current user session?
exit