Permissions and Ownership Flashcards
What does read permissions for a directory mean?
List directory content
What does write permissions for a directory mean?
Create, rename, delete
What does execute permissions for a directory mean?
Access directory, execute file, perform task
What is the command to modify the permissions of a file or directory?
sudo chmod [options] [mode] [file/directory]
What does the -c flag for chmod do?
Report changes
What does the -f flag for chmod do?
Hide error messages
What does the -v flag for chmod do?
Outputs a diagnostic for every file processed.
What does the -R flag for chmod do?
Recursively modify permissions
What is the command to view a users default permissions for newly created files and directories?
umask
What is the command to display a users default permissions for newly created files and directories in symbolic value?
umask -S
What is the command to display a users default permissions for newly created files and directories in number form value?
umask -p
What is the command to change the owner of a file or directory?
chown [user] [file/directory]
What is the command to change the user and group owner of a file or diretory?
chown [user]:[group] [file/directory]
What is the flag to recursively change the permissions of a directory?
-R
What is the command to change the group ownership of a file or directory?
chgroup [name] [file/directory]
What is Set User ID (SUID)?
User is allowed to have similar permissions as the owner of the file
What is Set User Group (SGID)?
User is allowed to have similar permissions as the group owner of the files and directories
What is the command to set a users SUID in Symbolic mode?
chmod u+s [file names]
What is the command to set a groups SUID in Absolute mode?
chmod 4### [file names]
What is the command to set a groups SGID in Symbolic mode?
chmod g+s [directory names]
What is the command to set a groups SGID in Absolute mode?
chmod 2### [directory names]
How do you remove a SUID or SGID?
Use the - operator in symbolic mode
Set to 0 in asbolute mode
What is the command to add a sticky bit in symbolic mode?
chmod +t [file/directory name]
What is the command to add a sticky bit in absolute mode?
chmod 1#### [file/directory name]
What is the command to add list the attributes of a file or directory?
listattr [options] [file/directory name]
What does the command listattr -R ?
Recursively list attributes of directories and contents
What does the command listattr -a do?
List all files
What does listattr -d do?
List directories
What does listattr -v do?
List files version number
What is the command to change the attributes of a file or directory?
chattr
What does chattr -R do?
Recursively change attributes of directories and content
What does chattr -v do?
Set files version number
What does chattr +l do?
Mark file as read-only and immutable
What does chattr -l do?
Remove read-only
What is the command to retrieve the ACL of files and directories?
getfacl
What is the command to change the permissions associated with the ACL of a file or directory?
setfacl
What does setfacl -r do?
Recursively set ACL permissions
What does setfacl -s do?
Set ACL
What does setfacl -m do?
Modify existing ACL
What does setfacl -x do?
Remove entries from existing ACL
What does setfacl -b do?
Remove all entries except standard permissions
What command can you use to verify permissions and verify the user and group ownership of a file or directory?
ls -al
What command can you use to verify a users groups?
groups [username]
What is the command to add a new group to a user?
sudo usermod -a -G [group] [user]
What is the command to change users primary group?
sudo usermod -g [group] [user]