Linux Permissions and Ownership Flashcards
**
Which command we use to change permissions of a file/directory?
chmod <permissions> <file or
directory name>
What are the different types of permissions in Linux?
read, write and execute, setuid, setgid, sticky
bit
What are the numeric values that the system assigns for read, write, and execute?
read=4, write=2,
execute=1
What are different ways to change the permissions of a file or directory?
permissions can be
changed symbolically using u, g, o, a, r, w, x. + to add permissions, - to take away permissions, = sets
the specified permissions.
numeric or octal and symbolic.
What does chown -R do?
changes ownership recursively
What is meant by chmod 777?
user, group and
other have read, write and execute permissions.
If you want to allow different users to access a directory, how would you ensure that users would
not be able to delete each other’s files/directories?
set sticky bit on the directory
How can we configure a directory called "/Project," so all the files and directories created in it by
any user have their default group to be "admins"?
chgrp admin /Project then chmod g+s /Project
How can we ensure that the user owner of a directory has read, write and execute permissions,
while the group and others have only read and execute permission? Please ensure all the subdirectories/files retain the same permissions as well. (Provide exact syntax).
chmod -R 755
<directory name> or chmod -R u=rwx,go=rx <directory name>
What is the purpose of umask?
command used to control the default permissions. user creation
mask
What is the default umask value for the "root" user and for a regular user?
0022 for root
and 0002 for regular user
If the umask value for a regular user is set to 0023, what permission will be set on a file when this user creates one?
644 – rw-r—r—
(0023 - mask the write permission for group, mask the write and execute permission for others)
If the umask value for a regular user is set to 0044, what permission will be set on a directory when this user creates one?
733 -rwx-wx-wx
What is Umask, and how do you set it for individual users and/or system-wide?
for regular
user vi .bashrc and systemwide is vi /etc/bashrc
source .bashrc will read your .bashrc file without logging you out.
What are the 3 special permissions in Linux besides read, write, and execute?
set UID –
allows a file to be executed with the permissions of the file owner, set GID, Sticky bit – prevents
accidental deletion of files by other users.