Files Flashcards
In long listing file details displayed, what are values for the first position?
- normal file
d directory
l is a symbolic link.
c is a character device file.
b is a block device file.
p is a named pipe file.
s is a local socket file.
change group ownership of a file file.txt to admins
chown : admins file.txt
show details of a directory
ls -ld directory
List of special permissions
1) Sticky
2) suid
3) guid
Explain sticky permission
Users can remove only files they own
How do you set sticky special permission
chmod +t folder
Explain suid special permission
File executes with owner’s permission instead of runner’s
Set suid special permission on file.sh
chmod u+s file.sh
Explain guid special permission
1) File executes as the group that owns the file.
2) New files inherit the group owner of the directory.
Set guid special permission on file.sh
chmod g+s file.sh
Explain the permissions: -rwsr-xr-x
User has suid special permission on the file. That means when someone executes the file, it runs with the owner permission instead of the runner permission
Add the setgid bit on the example directory by using the symbolic method
chmod g+s example
Remove the setuid bit on the example directory by using the symbolic method
chmod u-s example
Set setgid bit and add read, write, and execute permissions for user and group, with no access for others, on the example directory using the octal method
chmod 2770 example
displays the current value of the shell’s umask
umask