File/Directory Permissions Deck Flashcards
Review Permissions - Done as root user
chmod u+rwx file2
Add all permissions to owner of file2
chmod u-x file2
Remove the owner’s permission to execute file2
chmod g+w file2
Add permission to write to the group for file2
chmod o-rwx file2
Remove all permission for others for file2
chmod 777 dir1
Allow all permissions to all users for dir1
chmod 764 dir1
Allow the owner all permissions, the group read and write only and others read only for dir1
chmod g-rw file2
Remove read and write permission for the group for file2
chmod o+wx file2
Add write and execute permission for others for file2
chmod 464 dir1
Allow owner to read only, the group to read and write, the others to read only for dir1
chmod 661dir1
Allow the owner and the group to read and write only and the others to only execute for dir1
chmod 756 dir1
Allow owner all permissions, the group to read and execute only and the others to read and write only for dir1
chmod 532 dir1
Allow the owner to read and execute, the group to write and execute and the others to write only for dir1
Assign ownership of file8 to Group1
chown :Group1 file8
Check for file user and group ownership
ll
Assign ownership of dir4 to User2
chown User2 dir4
or
chown User2: dir4
Change group ownership of file2 from Group1 to Group2
chgrp Group2 file2
or
chown :Group2 file2
Change the owner and the group of file8 simultaneously. Group - Admin, Owner- User2
chown User2:Admin file8
Set user ID for Dir10 giving everyone permission to the directory as if they are the owner
chmod u+s Dir10
or
chmod 4(current permissions) Dir10
**current permission = 3 numerical permissions present on the directory
Set the group ID for file8, so that it belongs to the entire group
chmod u+s file8
or
chmod 2(current permissions) file8
**current permission = 3 numerical permissions present on the directory
Apply the sticky bit to file_B so that the user can only delete what the user owns
chmod o+t file_B
or
chmod 1(current permission) file_B
**current permission = 3 numerical permissions present on the directory