12 ownership, permissions, sticky bit Flashcards

1
Q

how do you change the ownership and group of apple.txt to a user peanut and group called sales using a single command?

A

sudo chown peanut:sales apple.txt

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

how would you change group membership of a file without root?

A

chgrp

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

how would you view the permissions, executability, or group of a file?

A

ls -l

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

What is SUID? When is it commonly used?

A

Set User ID, tells linux to run the program with the permissions of the owner rather than the user running the file. Use for password changes.

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

-rwsrwxrwx indicates what?

A

SUID bit has been set

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

What is SGID?

A

On executable files, it will grant the process resulting from executing the file access to the privileges of the group who owns the file.

When applied to directories, it will make every file or directory
created under it inherit the group from the parent directory.

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

-rwxrwsrwx indicates what?

A

SGID bit has been set

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

How do you set SGID with chmod?

A

2 at the front of the octal notation
g+s for symbolic

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

How do you set SUID with chmod?

A

4 at the front of the octal notation
u+s for symbolic

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

How do you set both SGID and SGUD with chmod?

A

6 at the front of the octal notation
ug for symbolic

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

ls -d does what?

A

displays information from subdirectories rather than the normal directories

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

how can you check if sticky bit is turned on?

A

ls -la;
if there is a “T” in place of execute permissions it is sticky

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

What do t the following octal prefixes do?
0
1
2
4
6

A

0 - turns off special bits
1 - turns on sticky bit
2 - enables SGID
4 - enables SUID
6 - enables both SGID and SUID

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

What does the letter t at the end of drwxrwxrwt indicate within the following directory permissions?

drwxrwxrwt 14 root root 36864 2012-03-02 11:17 /tmp

A

The t is a sticky bit, a specialized permission bit set on a directory that allows only the owner of the file within that directory, the owner of the directory, or the root user to delete or rename the file.

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