SUID
The sticky bit applied to executable programs flagging the system to keep an image of the program in memory after the program finished running.
But I don't know that what it's stored in memory. And how I can see them, in this case.?
filesystemspermissions
SUID
The sticky bit applied to executable programs flagging the system to keep an image of the program in memory after the program finished running.
But I don't know that what it's stored in memory. And how I can see them, in this case.?
Best Answer
This is probably one of my most irksome things that people mess up all the time. The SUID/GUID bit and the sticky-bit are 2 completely different things.
If you do a
man chmod
you can read about the SUID and sticky-bits. The man page is available here as well.background
excerpt
SUID/GUID
What the above man page is trying to say is that the position that the x bit takes in the rwxrwxrwx for the user octal (1st group of rwx) and the group octal (2nd group of rwx) can take an additional state where the x becomes an s. When this occurs this file when executed (if it's a program and not just a shell script) will run with the permissions of the owner or the group of the file.
So if the file is owned by root and the SUID bit is turned on, the program will run as root. Even if you execute it as a regular user. The same thing applies to the GUID bit.
excerpt
SUID/GUID examples
no suid/guid - just the bits rwxr-xr-x are set.
suid & user's executable bit enabled (lowercase s) - the bits rwsr-x-r-x are set.
suid enabled & executable bit disabled (uppercase S) - the bits rwSr-xr-x are set.
guid & group's executable bit enabled (lowercase s) - the bits rwxr-sr-x are set.
guid enabled & executable bit disabled (uppercase S) - the bits rwxr-Sr-x are set.
sticky bit
The sticky bit on the other hand is denoted as
t
, such as with the/tmp
directory:This bit should have always been called the "restricted deletion bit" given that's what it really connotes. When this mode bit is enabled, it makes a directory such that users can only delete files & directories within it that they are the owners of.
excerpt