![]() ![]() In the above example, bala.txt has rwx to users, groups, and others. Other users cannot delete or rename it because of sticky bit. However, even when the sub-directories or files under dir is having rwx permission to everybody, only the owner of those can delete or rename those files and directory. In the above example, as dir has rwx permission to everybody, all other users are allowed to do create their files or directories under this directory. rwxrwxrwx 1 guest guest 41 14:13 guest.txt In this example, it is drwxrwxrwt.ĭrwxrwxrwt 2 bala bala 4096 14:09 /home/bala/dir Once the sticky bit is assigned to a directory, you’ll see (t) as the last character in the permission. Or, you can assign only sticky bit to an existing directory (without touching any other user, group and other privileges) using chmod command as shown below. The example below, gives rwx permission to user, group and others (and also adds the sticky bit to the directory). If you are using the octal numbers in chmod, give 1 before you specify other numbered privileges, as shown below. ![]() The example below enables the sticky bit on a directory. When the sticky bit is set on a directory, only the owner and the root user can delete / rename the files or directories within that directory. If you set the sticky bit to a directory, other users cannot delete or rename the files (or subdirectories) within that directory. ![]() You would set the sticky bit primarily on directories in UNIX / Linux. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |