File Permissions Flashcards

1
Q

What is the syntax that constitutes a file permission?

A
  • |rwx|rwx|rwx (read write execute)
    type|user|group|other
    no access means -
    i.e -|r-x|-w-|rw-
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the syntax that constitutes a directory permission?

A

d|rwx|rwx|rwx (read write cdinto)
type|user|group|other
no access means -
i.e d|r-x|-w-|—

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

What is the octal notation associated with a file/folder permission?

A

d|421|421|421
d|rwx|rwx|rwx
-|421|421|421
-|rwx|rwx|rwx

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

What would the octal notation equivalent be for d|r-x|r-x|rwx?

A

d|r-x|r-x|rwx = d|5|5|7

d|4+0+1|4+0+1|4+2+1

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

What would the octal notation equivalent be for -|rwx|r–|—?

A
  • |rwx|r–|— = -|7|4|0

- |4+2+1|4+0+0|0+0+0

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

How would you change the permissions of a file/folder without octal notation?

A

chmod u/g/o +/- r/w/x file/folder

i. e chmod ug+x file/folder
* have to repeat for giving unique permissions (appending and omitting)

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

How could you change the permissions of a file/folder using octal notation

A

chmod nnn file/folder

i. e chmod 750 file/folder
* efficient in giving unique permissions in one command (arbitrarily set)

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

What is a sticky bit?

A

In linux all users including other can delete a write protected file if they have permissions of the containing folder
Setting the sticky bit on folder allows only the deletion of things you own

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

How do you set the sticky bit for a folder without octal notation?

A

chmod o+t folder

*only applies to the permission of other

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

How do you remove the sticky bit for a folder without using octal notation?

A

chmod o-t folder

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

How do you set the sticky bit for a file using octal notation?

A

chmod 1nnn folder

i.e chmod 1770 folder

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

How do you remove the sticky bit for a file using octal notation?

A

chmod 0nnn folder

i.e chmod 0770 folder

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

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

A

chown user:group file

*leave either field blank to change only user/group

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

How do you change the permissions of a folder recursively?

A

chmod -R >permission< directory

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

How would you change the permissions of the contents of a directory excluding the folder itself?

A

chmod -R >permission< directory/*

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

What is the permission hierachy for files and directories?

A

user
group
other

*first membership applies

17
Q

What is the command to create a symbolic link?

A

ln -s /path/to/file linkname

18
Q

What is the command to remove a symbolic link?

A

unlink

i.e unlink linkename

19
Q

What is denoted by file with c as the listing?

A

Character device

20
Q

What is denoted by file with b as the listing?

A

Block device

21
Q

What is denoted by file with l as the listing?

A

Symbolic Link