Users and groups Flashcards

1
Q

Add user in Linux?

A

“useradd” is the command

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

Can we modify user?

A

Yes, “usermod” is the command

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

Default values for users

A

/etc/login/defs
/etc/skel
/etc/default/useradd

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

What is the easiest way to access super user privileges?

A

su (substitute user) is the command
login as other user: su -
login as root: su -

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

Add password for user

A

passwd is the command

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

When do we need super user privileges?

A

System wide changes
Changes that affect other user
Configure services

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

View and set password policies (expiry date, etc..)

A

chage is the command
chage -l lists user password policy
note: policies include expiry period, etc.

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

How to create a group on Linux?

A

groupadd is the command

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

Modify and add users to groups on Linux?

A

groupmod to modify
gpasswd to add user
we can also add users to a group on useradd/usermod commands

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

View groups and users?

A

List users: /etc/passwd file
List user passwords: /etc/shadow file
List groups: /etc/group file
We can also use getent command - getnet passwd , getent group
We can use groups command as well to list user in a group - groups

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

What if I just want to perform a single command with supper user privileges?

A

We can use “sudo” command

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

Who is allowed to use “sudo” command?

A

Groups authorized in /etc/sudoers file
Groups like “sudo”, etc..
We can also authorize certain groups to execute certain commands on certain machines

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

How to edit sudoers file?

A

Best to use “visudo” command

Note: we need super user privileges

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

How to change password lenght and complexity policies in Linux?

A

Modify /etc/security/pwquality.conf

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