Chapter 7 - Permission Management Flashcards
Who are the different owners for a file or directory?
user
group
others
Who owns the file in terms of user, group owner when a new file is created?
Owners are set when a file or directory is created. On creation, the user who creates the file becomes the user owner, and the primary group of that user becomes the group owner
Which command can be used to check the current ownership permissions?
ls -l
Which command can be used to get a list of all files on the system that have a given user or group as the owner?
fine command with -user option
Example : find / -user linda
Which command is used to change a user and group ownership
chown - can be used to change both user and group ownership of a file
chgrp - can be used to change the group ownership
what is the syntax of chown command?
chown who what
example - chown linda account
changes the user ownership of the file account to linder user
Which option with chown, allows you to set ownership recursively, which allows you to set ownership
of the current directory and everything below
chown -R
when you change group ownership of a file or directory how to use chown command?
chown .account /home/account
so we use a . or : in front of the group name to identify that or indicate that itis a group.
What are the all possible ways to use chown command to change the user and group ownerships
chown lisa myfile chown lisa.sales myfile chown lisa:sales myfile chown .sales myfile chown :sales myfile
How to use chgrp command to change the group ownership?
following example, where you can use chgrp to set group ownership for the directory /home/account to the group account:
chgrp account /home/account
If the user is a member of more groups, how to change the effective primary group
groups command to view the active primary group membership of a user
newgrp command to change the effective primary group of a user
Which command to use to apply permissions?
chmod
What permission needed on a directory if you wanted to do anything inside of the directory?
execute
What are the numeric representation of the permissions?
Read 4
Write 2
Execute 1
Give an example of how the permissions can be modified relative to the current permissions?
chmod g+w,o-r somefile