Permissions Flashcards
What is the syntax that constitutes a file permission?
- |rwx|rwx|rwx (read write execute)
type|user|group|other
to omit access put a -
i.e -|r-x|-w-|rw-
What is the syntax that constitutes a directory permission?
d|rwx|rwx|rwx (read write cdinto)
type|user|group|other
to omit access put a -
i.e d|r-x|-w-|—
What is the octal notation associated with a file/folder permission?
d|421|421|421
d|rwx|rwx|rwx
-|421|421|421
-|rwx|rwx|rwx
What would the octal notation equivalent be for d|r-x|r-x|rwx?
d|r-x|r-x|rwx = d|5|5|7
d|4+0+1|4+0+1|4+2+1
What would the octal notation equivalent be for -|rwx|r–|—?
- |rwx|r–|— = -|7|4|0
- |4+2+1|4+0+0|0+0+0
How would you change the permissions of a file/folder without octal notation?
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 could you change the permissions of a file/folder using octal notation
chmod nnn file/folder
i. e chmod 750 file/folder
* efficient in giving unique permissions in one command (arbitrarily set)
What is sticky bit?
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 do you set the sticky bit for a folder without octal notation?
chmod o+t folder
*only applies to the permission of other
How do you remove the sticky bit for a folder without using octal notation?
chmod o-t folder
How do you set the sticky bit for a file using octal notation?
chmod 1nnn folder
i.e chmod 1770 folder
How do you remove the sticky bit for a file using octal notation?
chmod 0nnn folder
i.e chmod 0770 folder
What is the command to change the owner of a file or directory?
chown user:group file