Users and Groups Flashcards

1
Q

Which file allows you delegate sudo privileges to users?

A

/etc/sudoers

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

Which editor is recommended to use when editing the sudoers file?

A

visudo

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

Why is visudo the recommended editor for editing sudoers?

A

Verifies syntax texts before committing changes

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

What is the visudo command to open the sudoers file?

A

sudo visudo /etc/sudoers

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

What does the -c flag for visudo do?

A

Check for file errors

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

What does the -f flag for visudo do?

A

Edits the file

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

What does the -s flag for visudo do?

A

Checks the file in strict mode

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

What does the -x flag for visudo do?

A

Outputs in JSON

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

What is PolicyKit?

A

PolicyKit is a Linux component that controls system-wide privileges that allows non-privileged processes to communicate with privileged ones

Example: pkexec mkdir Nick

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

What is the command to create a new user?

A

sudo useradd [options] [username]

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

What does the -c flag for useradd do?

A

Add a comment to the comment field

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

What does the -e flag for useradd do?

A

Sets an expiration date for the user

Example: useradd –e [yyyy][mm][dd] [username]

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

What does the -s flag for useradd do?

A

Sets the users default shell

Example: useradd –s /bin/ksh [username]

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

What does the -D flag for useradd do?

A

View the default configurations for new users

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

What is the command for the root user to change or reset the password for another user?

A

sudo passwd [username]

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

Newly created users are configured based on which file?

A

/etc/login.defs

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

What is the command to change a users expiration date?

A

sudo chage -E yyyy/mm/dd [user]

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

What is the command to run a previous command as sudo without typing the command out again?

17
Q

What is the command to change the maximum days until a user must change their password?

A

sudo chage -M [days] [user]

18
Q

What is the command to change the days until a user receives a warning before their password expires?

A

sudo chage -W [days] [user]

19
Q

How do you display account aging information of a user?

A

sudo chage -l [user]

20
Q

What is the command to change a users username?

A

sudo usermod -l [username]

21
Q

How do you change a users username?

A

sudo usermod -l [newusername] [oldusername]

22
Q

What is the command to lock a account?

A

sudo passwd -l [username]

23
What is the command to unlock a account?
sudo passwd -u [username]
24
What is the command to delete a user?
sudo userdel [username]
25
What is the command to delete a user, including their home directory?
sudo userdel -r [username]
26
What is the command to add a new group?
sudo groupadd [options] [groupname]
27
What does the -f flag groupadd do?
Exists if the group already exists
28
What does the -o flag groupadd do?
Creates a group with a non-unique id
29
What is the command to modify a groups attributes?
sudo groupmod [options] [group]
30
What is the command to modify a groups ID?
sudo groupmod -g [id] [groupname]
31
What is the command to rename a group?
sudo groupmod -n [newname] [oldname]
32
What is the command to delete a group?
sudo groupdel [options] [groupname]
33
What is the command to display the username currently logged into the system?
whoami
34
What is the command to display the details of users currently logged in
who
35
What is the command to display the details of users currently logged in to the system and their transactions?
w
36
What is the command to display the history of user login and logout actions, and the actual time and date?
last
37
Which file does the last command use to retrieve information?
/var/log/wtmp
38
What is the .bashrc file?
Enables customization of a users environment
39
What are two things that can be customized in the .bashrc file?
Default directories and permissions, default command prompt
40
What is the bash_profile file?
Provides the shell configuration for the initial login environment
41
What is the /etc/profile file?
Provides system-wide environmental variables that are used to apply certain settings to user accounts ~/.bash_profile ~/.bash_login ~/.profile
42
What is /etc/profile.d?
Serves as a storage location for scripts that admins may use to set additional system-wide variables