SUID (Set user ID) - the SUID permission applies when you want a user to run an executable file that she normally cannot. For example, if only root can run the program “batch”, you can set the SUID on “batch” so that whoever runs the script becomes root only within the framework of that script. The numerical permission on SUID is 4000. When applied, it changes the “x” in the execute field to an “s”.
chmod 4777 batch
ls -l batch
-rwsrwxrwx 1 root root
Hm, I was under the impression that the SUID-bit would allow a user to run a command/script with the same user who owns the command. Similiarly, if the GUID bit is set, the user running the script will do so under the group who owns the command.
In most cases SUID means 'run as root', (for example the ping and traceroute commands which require access to the low level network drivers not avalablie to regular users), but this in not always true.
On a Linux machine, do a 'man chmod' and it will explain the various bits, and also explain the sticky-bit, which has to do with how the OS handles swapping of memory when the command is executed.
However, the above ir related to files. The same bits have different meanings when set on directories. But that's another story.
No, its not the sticky bit. The sticky bit, when applied to a directory, prevents users from deleting files or folders that grant them the write permission unless they are the owner of the file. When applied to a file, the file becomes sticky. The first time the file is run or accessed, and loaded into memory, it stays loaded into memory or swap space so that it can run faster than it would if read from the drive. The numeric value is 1000. If the file is not executable, the last permission bit becomes “T”. If the file is an executable file, or the permission applies to a directory, the last bit becomes a “t”. When you apply the permission via chmod using symbolic letters, the “t” appears regardless of the type of entity being changed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.