7. User Management and Permissions in Linux Flashcards

1
Q

What is the command to see what user I’m currently logged in?

A

whoami

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

Do I need root access to the system in order to create new user? (Yes or No)

A

Yes

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

How to execute a command as the root user when logged in as a regular user?

A

with the prefix “sudo”

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

What are the command to add a new user?

A

useradd and adduser

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

What is the command to log as another user?

A

su (switch user)

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

What is the command to add a password to a user?

A

passwd [USER NAME]

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

What is the command to remove a user?

A

userdel

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

What is the command to add a user with home directory?

A

useradd -m

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

Where is the configuration file of the command useradd?

A

/etc/default/useradd

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

What is the command to see the shell we are currently using in sh shell?

A

$0

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

What is the command to switch user with a complete new session?

A

su - or su -l or –login

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

What is the command to remove a user and its home diretory?

A

userdel -r

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

Where are located the information about users?

A

/etc/passwd

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

How are the information displayed for each user in the passwd file?

A

user name : x : user id : group id : , , , : home directory : shell

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

Where is the default configuration file of adduser located?

A

/etc/adduser.conf

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

What is the command to change the ownership of a file or folder?

A

chown user:group

17
Q

What is the command to change ownership recursivly?

A

chown -R or chown –recursive

18
Q

What is the permission rwx in binary?

A

7

19
Q

What is the permission rw- in binary?

A

6

20
Q

What is the permission r– in binary?

A

4

21
Q

What is the command to change permission?

A

chmod

22
Q

How to remove a specific permission ?

A

chmod -x

23
Q

How to add a specific permission ?

A

chmod +x

24
Q

How to add or remove permissions for group?

A

chmod g-x