Lesson 3: Managing Permissions and Ownership Flashcards
True of False ls -l will allow you to view permission set
True
What are the following permission symbols d-r-w-x–
Directory-read-write-executable-none
What common command do you use to modify per
qmission?
The change file mode command “chmod”
In symbolic mode, the syntax of the chmod command is:chmod {access context} {operators} {permission attributes} {file/directory names}
example: to add read and write permissions to my file for the owner and the group: chmod u+rw,g+rw myfile
What are the types of users and entities can you give permission to?
Owner (u): The owner of the file or directory, also simply referred to as the user
Group (g): The file or directory’s group and all users belonging to that group
Other (o): All other users (neither owner nor group member)
Where does default permission come from?
The default permission come from the in /etc/profile for all users OR ~/.bashrc for one user
How do we define who the owner or group is?
chown - which can be used to change owner
or chgrp - which can change group of a file
The syntax of the chown command: chown {user name}:{group name} {file ordirectory name} -> to change the owner to the specified user, as well as the specified group.
How do you seize ownership of every directory and its sub directories?
chown -R [user] directory/*
What is FACL?
File Access Control List
made up of ACE - Access Control Entries
How do you confirm if ACL is enable of a object?
getfacl {object_name} and see what returns
How do give access to an object to another user without changing ownership?
You can use setfacl -m modify
the option -s allow you to set permission which may override what is already set
What limitations do we have with basic permissions?
Limitations only allow one user and one group. It is not very flexible and the users apply their primary group by default.
How can you overcome the limitations of basic permissions?
Be using ACLs/FACLs, which allows assigning permissions to more than one user/group
How do you assign group permission using FACL?
You use setfacl -m g::rwx
The syntax of the setfacl command is setfacl [-bR] [-mx {acl_spec}] {file/directory names}
How do you assign permission using FACL on a directory?
Directory permissions can be passed down to files through enable inheritance or use setfacl -m d:g::rwx
Note: The d: indicates it is a directory default and f: can be used to set a file default
What advanced permission prevent files from being deleted by anyone other then root or the file owner?
Sticky bit, files with the sticky bit can only be deleted/renamed by root or the file owner and allows for “Friendly” shared directories.
example: chmod o+t
What command displays permission information?
ls -l
command gives you a long list of the files and directories in your currentworking directory.
What two modes does chmod support?
symbolic mode and absolute mode
What is chmod absolute mode?
Absolute mode, uses octal (base-8) numbers to specify permissions. Each permission (r/w/x) has an associated number.
4=Read, 2=Write and 1=Execute
the syntax of the chmod command is chmod {number} {file/directory name}
commonly assigned permissions in “Absolute Mode”
- 755u= rwx , g=rx , o=rx
- 700u= rwx , g= , o=
- 644u= rw , g=r , o=r
- 600u= rw , g= , o=
How do you view permissions of a directory?
ls -ld {directory name}
uHow do you change default permission ?
You can use the umask command to set the default permissions for a session, or the default permissions for each user in their .bashrc file.
How do you change group ownership for a file or directory?
chgrp
The syntax of the chgrp command is chgrp {group name} {file/directory name}
What is SUID?
SUID or setuid, is a special permissions that allows a user to have similar permissions as the owner of the file.
What is SGID?
SGID, or setgid, is the special permission that allows a user to have similar permissions as the group owner of the file.
note: SGID can also be set on directories. Any subdirectories created in this directory will automatically inherit the SGID permission.
How do you set the SUID and or SGID special permissions?
SUID and SGID are both set using the chmod command.
the syntax is as follows:
chmod u+s for setting SUID
chmod g+s for setting SGID