Linux Fundamentals Flashcards
At what 3 levels can file permissions be applied?
User, group, other
What is the command to change file permissions?
chmod
What are the numerical values of read, write, and execute respecivley?
4, 2, 1
What is the declarative way of adding/removing file permissions?
u/g/o/a +/- r/w/x (e.g. u+w == give write permissions to user, ug-rw == remove read/write for user and group)
Why do directories need execute permissions?
To allow cd to execute against it so it can be accessed
What is the numerical value of no permissions on a file/dir?
0
What commands changes the ownership of a file?
chown
What commands changes the ownership of a file?
chgrp
Who has complete control over the files in a users home directory besides root?
The user - drwxr-x— permissions state that the user can read, write, and execute on any file regardless of the owner (even root!)
What is an ACL?
Access Control List
How does an ACL work with UNIX style permissions?
ACLs provide more fine grained controls over permissions, allowing specific users or groups access to disk resources
What command sets ACL permissions?
setfacl
What command gets ACL permissions?
getfacl
Give an example of the setfacl function
setfacl -m u:<user>:rw /path/to/file</user>
How can a single permission be removed for a single user using ACLs?
setfacl -x u:user /path/to/file
What symbol is added to end of the permissions list when using ACLs?
+
Does write permissions by ACL allow you to delete files?
No
How do you reset ACL file permissions?
setfacl -b /path/to/file
Name a quick command with one line command descriptions
whatis
What information option is usually available to all commands?
–help or -h
List 4 help commands
whatis, whereis, man, apropos
How can multiple commands be run from the terminal?
Separate them with a semi-colon. Example: whoami; pwd; ls -l;
How can multiple commands be run from the terminal while ensuring the next command only runs if the preceding command is successful?
Separate them with a double ampersand. Example: mkdir -p /path/to/dir && cd /path/to/dir && touch new_file