Linux Users And Groups Admin Flashcards

1
Q

How would you add a user John Doe?

A

useradd -c COMMENT/FULLNAME -e YEAR/MONTH/DAY -s SHELL PATH -d /HOME PATH jdoe

Where
-c is to add a comment (frequently full name)
-e gives an expiry date
-s specifies a shell
-d specifies home directory (tho you need to create if you use this and don’t go with default)

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

How do you change your group context (the group your CL is presently operating in)?

A

newgrp GROUPNAME

or

chown USER:GROUP FILE

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

How do you find out what groups someone is in?

A

sudo id USER

groups (for yourself)

Or check /etc/passwd or etc/group

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

What is umask?

A

User file-creation mode Mask is used to set default file and dir permissions.

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

What is FACL?

A

File System Access Control List

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

Where do you go to manage default password/login settings

A

/etc/login.defs

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

What is PAM?

A

Plug-in Authentication Module

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

How to change the file or directory group (2 ways)

A

chgrp GROUP FILE
chown USER:GROUP FILE

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

Change file or directory ownership

A

chown USER FILE

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

Change permissions symbolically

A

chmod (u/g/o) (+/-/=) (r/w/x) FILE

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

Change permissions with octal method

A

chmod OCTAL FILE
- - - = 0
- - x = 1
- w - =2
r - - = 4

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

What is the Set User ID (SUID) Bit?

A

Used on executables , it tells kernel to run with owner permission for standard users.
Indicated by an s instead of x for the owner.
In octal set 4- - -

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

What is the Set Group ID (SGID) bit?

A

For files - run executable with groups permissions. Shows as and s instead of x for group
In octal set 2- - -
For directories - ensure new files created in a directory are set to directory group permission and not user permission which is better for sharing.

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

What is the sticky bit?

A

Used to protect a file from deletion by those that don’t own it. Shoes by a ‘t’ instead of ‘x’ for ‘others’
In octal mode set 1- - -

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

What are the umask octal codes

A

Files. Dirs
027 - rw- r- - - - - rwx r-x - - -

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

What does ‘ulimit’ do?

A

It can be used to restrict system resources per user.

17
Q

What does ‘chattr’ do?

A

Modifies attributes assigned to an f or d
eg modifications, deletions, compression, indexing …

18
Q

what does “useradd -D” do?

A

Displays the active directives in the /etc/default/useradd (configuration) file.

Can also be used to amend directives with appropriate switches

19
Q

Where does “last” get its data from

A

/var/log/wtmp