User & Group Management Flashcards

1
Q

What command shows the current user?

A

whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which command displays the user ID (UID) and group ID (GID)?

A

id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command lists the groups the user belongs to?

A

groups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: To create a new user with a home directory, use the command _______.

A

sudo useradd -m <username></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command is used to change or set a user password?

A

sudo passwd <username></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which command deletes a user?

A

sudo userdel <username></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What command creates a new group?

A

sudo groupadd <groupname></groupname>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Fill in the blank: To add a user to a group, use the command _______.

A

sudo usermod -aG <group> <user></user></group>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command allows you to switch to another user?

A

su <username></username>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What command exits the current user session?

A

exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly