Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

-r-s--x--x 2

Status
Not open for further replies.

farley99

MIS
Feb 12, 2003
413
US
what does the s mean in -r-s--x--x?
-r-s--x--x 1 root root 15104 Mar 13 2002 passwd*
 
Superuser. Gives the file more permissions rather than the owner or group.
 
How do i chmod something to that? What do you mean by "more permissions"
 
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


Chris
 
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.

~Mike


 
Hi,

yes, its the socalled "sticky" bit
 
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.

ChrisP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top