104.5 Manage file permissions and ownership Flashcards
What is a synonym of ‘permission’ for a directory or file?
Mode
What are the symbolic ways to represent modes or permissions on a file?
r,w,x (read-write-execute)
What does the write permission mean in a directory or file?
Someone can write to the directory or file or change its name
What does the “x” permission mean for a directory?
Someone can execute the action of opening that directory (cd into it).
What are the octal values of permission symbols?
r=4
w=2
x=1
-=0
What is the command to change the permissions of a file?
chmod
What is the command to change the permissions of a file for others(world) with the symbolic method removing the read permission?
chmod o-r
How do you change the permissions of files (remove read from others) within a directory recursively without changing the directory’s permissions?
chmod -R o-r /*
How do you remove group and world permissions from a file using octal notation, keeping read and write for the user(owner)?
chmod 600
What command do you use to change the owner of a file or directory?
chown or #chgrp
How do you change the group ownership on a file or a directory for a group?
#chown : #chgrp
What is the only user that can change the user ownership of a file?
Root
What happens if the uid of the user matches the owner of a file or directory?
Those permissions apply and the user can open the file or directory.
What happens if the uid of the group matches the group of a file or directory?
Those permissions apply and the group members can open the file or directory.
What happens if the uid of the user or the group don’t match?
The ‘other’ permissions apply.
Can any user change his own password using the passwd command?
Yes, any one can in spite of the user and group being root:root
What is the ‘s’ in -rwsr-xr-x within the user’s column?
The ´s´ stands for SUID (set User ID bit)
What does the SUID (set User ID bit) do?
Applications with an ‘s’ in the place of the ‘x’ permission within the user’s column allow any user to run the program as if they were the owner of the application