chown, umask, SUID, SGID and the sticky bit
Sign in to read this lesson
Even with the right permissions, nothing works if a file belongs to the wrong user. In this lesson we learn to change the owner and group (chown, chgrp), the umask that sets permissions of new files, and three special bits — SUID, SGID and sticky — and build a shared directory for a team.
What you will learn
sudo chown user:group filechanges owner and group together;-Rfor a whole directory.- umask is the permissions taken away from new files and directories:
022→ file 644, directory 755. - SUID (
sin the owner position) runs a program as the file's owner — for examplepasswd. - SGID on a directory (
sin the group position) gives new files the directory's group — ideal for shared directories. - The sticky bit (
t) on a directory lets everyone delete only their own files —/tmpworks like this.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.