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?

A

sudo !!

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
Q

What is the command to unlock a account?

A

sudo passwd -u [username]

24
Q

What is the command to delete a user?

A

sudo userdel [username]

25
Q

What is the command to delete a user, including their home directory?

A

sudo userdel -r [username]

26
Q

What is the command to add a new group?

A

sudo groupadd [options] [groupname]

27
Q

What does the -f flag groupadd do?

A

Exists if the group already exists

28
Q

What does the -o flag groupadd do?

A

Creates a group with a non-unique id

29
Q

What is the command to modify a groups attributes?

A

sudo groupmod [options] [group]

30
Q

What is the command to modify a groups ID?

A

sudo groupmod -g [id] [groupname]

31
Q

What is the command to rename a group?

A

sudo groupmod -n [newname] [oldname]

32
Q

What is the command to delete a group?

A

sudo groupdel [options] [groupname]

33
Q

What is the command to display the username currently logged into the system?

A

whoami

34
Q

What is the command to display the details of users currently logged in

A

who

35
Q

What is the command to display the details of users currently logged in to the system and their transactions?

A

w

36
Q

What is the command to display the history of user login and logout actions, and the actual time and date?

A

last

37
Q

Which file does the last command use to retrieve information?

A

/var/log/wtmp

38
Q

What is the .bashrc file?

A

Enables customization of a users environment

39
Q

What are two things that can be customized in the .bashrc file?

A

Default directories and permissions, default command prompt

40
Q

What is the bash_profile file?

A

Provides the shell configuration for the initial login environment

41
Q

What is the /etc/profile file?

A

Provides system-wide environmental variables that are used to apply certain settings to user accounts

~/.bash_profile
~/.bash_login
~/.profile

42
Q

What is /etc/profile.d?

A

Serves as a storage location for scripts that admins may use to set additional system-wide variables