Ch 6 User and Group Management Flashcards

(20 cards)

1
Q

The root user should ONLY be used for what?

A

system administration tasks

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

Why doesn’t modern RHEL have a root account enabled by default?

A

because you can just make an ordinary user, and make it priviliged by using sudo when needed. Don’t need to make a password for root

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

What command gives you information about a user account?

A

id

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

what is the superuser?

A

the root user

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

is the root user on all linux systems?

A

yes, by default they all have a root user

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

what is the purpose of the superuser or root user?

A

for managing Linux with no restrictions

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

what sorts of tasks require root privileges?

A

installing software

managing users

creating partitions on disk devices

…or anything else allowing direct access to devices

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

what is a hazard of always being root user, especially in a graphical environment?

A

all tasks you do are launched as root, which adds unnecessary risk

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

what are alternatives to being always the root user?

A

su

sudo

PolicyKit

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

what are the distinctions between su and sudo?

A

su switches the current user’s identity to another user, including root. requires target user’s password.

while sudo allows users to run specific commands with root privileges without changing their identity. sudo requires the current user’s password.

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

how is PolicyKit different from su and sudo?

A

PolicyKit, su, and sudo are all mechanisms for granting elevated privileges in Linux, but they differ in their approach and scope.

PolicyKit provides a more fine-grained and application-specific approach, whereas su and sudo primarily handle user-level privileges.

(you can set up graphical utilities to run with administrative privileges)

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

When using su creates a subshell with a new identity, what is not set?

A

environment settings, because you’re in a new shell. To get not just the new user but their entire environment as well, use

su -

the hyphen.

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

su -

starts what kind of shell?

A

a login shell

which means all scripts that make the user environment are processed

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

what command will tell you who the currently logged in user is?

A

whoami

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

what’s a quick command for creating a user?

A

useradd [name]

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

how can an admin user be modified to be added to a group wheel?

A

usermod -aG wheel user

17
Q

what does visudo do?

A

edits the /etc/sudoers file – locks it against simultaneous edits, performs basic validity checks, checks for syntax errors – all before t installs the edited file

opens in nano

18
Q

say you have the following line in /etc/sudoers:

linda ALL=/usr/bin/useradd,/usr/bin/passwd

what does it mean?

A

this allows the user linda to ONLY be able to run the commands useradd and passwd with admin privileges (with sudo)

19
Q

does a command prefixed with sudo allow piping?

A

no, unless you add the -c flag

e.g.

sudo sh -c

you can run any command containing a pipe as its argument

sudo sh -c “rpm -qa | grep ssh”