Manage users and groups Flashcards

1
Q

how to create an account called user with UID of 1005

A

useradd -u 1005 user

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

how to add the account user to admin group

A

usermod -aG admin user

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

how to lock the user account

A

usermod -L user

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

how to unlock the user account

A

usermod -U user

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

how to set the maximum age of user’s password to 90 days

A

chage -M 90 user

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

how to check the maximum age of user’s password

A

chage -l user

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

how to force password change on first login for user

A

chage -d 0 user

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

how to set specific date user’s password will expire

A

chage -E 2019-07-24 user

run date -d “+180 days” +%F if you want to get 180 days from today in this format

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

how to delete the account user

A

userdel user

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

how to change user’s password

A

passwd user

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

how to create a group with GID of 3000 called operators

A

groupadd -g 30000 operators

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

how to delete a group called operators

A

groupdel operators

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

how to give a user sudo access

A

visudo

vim /etc/sudoers

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