12 ownership, permissions, sticky bit Flashcards
how do you change the ownership and group of apple.txt to a user peanut and group called sales using a single command?
sudo chown peanut:sales apple.txt
how would you change group membership of a file without root?
chgrp
how would you view the permissions, executability, or group of a file?
ls -l
What is SUID? When is it commonly used?
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.
-rwsrwxrwx indicates what?
SUID bit has been set
What is SGID?
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.
-rwxrwsrwx indicates what?
SGID bit has been set
How do you set SGID with chmod?
2 at the front of the octal notation
g+s for symbolic
How do you set SUID with chmod?
4 at the front of the octal notation
u+s for symbolic
How do you set both SGID and SGUD with chmod?
6 at the front of the octal notation
ug for symbolic
ls -d does what?
displays information from subdirectories rather than the normal directories
how can you check if sticky bit is turned on?
ls -la;
if there is a “T” in place of execute permissions it is sticky
What do t the following octal prefixes do?
0
1
2
4
6
0 - turns off special bits
1 - turns on sticky bit
2 - enables SGID
4 - enables SUID
6 - enables both SGID and SUID
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
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.