Using sticky bit

The sticky bit special permission is used to put a restriction on the deletion of files. When sticky bit is set on a directory, then only the owner of the file and the root user can delete the files within that directory, for example:

The /tmp folder has got sticky bit applied by default in Linux systems, as shown in the following screenshot:

The following example illustrates the usage of the chmod command to add sticky bit to a directory:

$ ls -ld mydir
$ chmod o+t mydir

or

$ chmod 1775 mydir
$ ls -ld mydir
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.253.221