Permissions and Ownership Flashcards

1
Q

What does read permissions for a directory mean?

A

List directory content

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

What does write permissions for a directory mean?

A

Create, rename, delete

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

What does execute permissions for a directory mean?

A

Access directory, execute file, perform task

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

What is the command to modify the permissions of a file or directory?

A

sudo chmod [options] [mode] [file/directory]

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

What does the -c flag for chmod do?

A

Report changes

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

What does the -f flag for chmod do?

A

Hide error messages

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

What does the -v flag for chmod do?

A

Outputs a diagnostic for every file processed.

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

What does the -R flag for chmod do?

A

Recursively modify permissions

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

What is the command to view a users default permissions for newly created files and directories?

A

umask

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

What is the command to display a users default permissions for newly created files and directories in symbolic value?

A

umask -S

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

What is the command to display a users default permissions for newly created files and directories in number form value?

A

umask -p

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

What is the command to change the owner of a file or directory?

A

chown [user] [file/directory]

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

What is the command to change the user and group owner of a file or diretory?

A

chown [user]:[group] [file/directory]

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

What is the flag to recursively change the permissions of a directory?

A

-R

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

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

A

chgroup [name] [file/directory]

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

What is Set User ID (SUID)?

A

User is allowed to have similar permissions as the owner of the file

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

What is Set User Group (SGID)?

A

User is allowed to have similar permissions as the group owner of the files and directories

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

What is the command to set a users SUID in Symbolic mode?

A

chmod u+s [file names]

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

What is the command to set a groups SUID in Absolute mode?

A

chmod 4### [file names]

20
Q

What is the command to set a groups SGID in Symbolic mode?

A

chmod g+s [directory names]

21
Q

What is the command to set a groups SGID in Absolute mode?

A

chmod 2### [directory names]

22
Q

How do you remove a SUID or SGID?

A

Use the - operator in symbolic mode
Set to 0 in asbolute mode

23
Q

What is the command to add a sticky bit in symbolic mode?

A

chmod +t [file/directory name]

24
Q

What is the command to add a sticky bit in absolute mode?

A

chmod 1#### [file/directory name]

25
Q

What is the command to add list the attributes of a file or directory?

A

listattr [options] [file/directory name]

26
Q

What does the command listattr -R ?

A

Recursively list attributes of directories and contents

27
Q

What does the command listattr -a do?

A

List all files

28
Q

What does listattr -d do?

A

List directories

29
Q

What does listattr -v do?

A

List files version number

30
Q

What is the command to change the attributes of a file or directory?

A

chattr

30
Q

What does chattr -R do?

A

Recursively change attributes of directories and content

31
Q

What does chattr -v do?

A

Set files version number

32
Q

What does chattr +l do?

A

Mark file as read-only and immutable

33
Q

What does chattr -l do?

A

Remove read-only

34
Q

What is the command to retrieve the ACL of files and directories?

A

getfacl

35
Q

What is the command to change the permissions associated with the ACL of a file or directory?

A

setfacl

36
Q

What does setfacl -r do?

A

Recursively set ACL permissions

37
Q

What does setfacl -s do?

A

Set ACL

38
Q

What does setfacl -m do?

A

Modify existing ACL

39
Q

What does setfacl -x do?

A

Remove entries from existing ACL

40
Q

What does setfacl -b do?

A

Remove all entries except standard permissions

41
Q

What command can you use to verify permissions and verify the user and group ownership of a file or directory?

A

ls -al

42
Q

What command can you use to verify a users groups?

A

groups [username]

43
Q

What is the command to add a new group to a user?

A

sudo usermod -a -G [group] [user]

44
Q

What is the command to change users primary group?

A

sudo usermod -g [group] [user]