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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

permission s and S for directories !

Status
Not open for further replies.

haux

Programmer
Apr 11, 2001
79
DZ
I know that file directory permission can be :
drwxrwxrwx (owner-group-other)

OK but i had found in our server (web server)(i am newbie to linux :(
directory (in /home/)directory like this:
drwsr-s--- !!!!!!!!!!! what is 's' how i can make a directory with s properties ????

and one directory like this : drwsr-S--- Yes S in uppercase !!!!

I am lost any explication :(

Thanks for all
 
This is only a guess on my part but I'm going to say that -s and -S are attributes rather than permissions.
 
No, they are not attributes. They are permissions:

chmod 2755 directory sets the setgid, chmod 1755 would set the "t" or sticky bit, chmod 4755 gives setuid, and chmod 04700 would show the capital S.

This stuff should be documented in "info chmod", but it isn't. I dunno where Linux documents it; on other Unixes you sometimes find it under "man ls".

Setgid on a directory means that any files created by ANYBODY will have the group ownership set to that of the dirtectory.

The "t" bit means that only the person who owns the file (and root, of course) can remove the file even if other folks have write perm on the directory (whithout this anyone with write perm could delete other peoples files).

The capital S means that setgid is on but there's no write permission.

AFAIK, setuid is meaningless on a directoty even though you can set it.


Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
hi,



setuid and setgid are documented to some extent in section two of the manual. See : 'man 2 chmod'.



The difference between a lower case 's' and an upper case 'S' is that in the latter case there is no underlying execute permission. For example :



$ mkdir tmp

$ chmod 700 tmp

$ ls -ld tmp

$ chmod 2700 tmp

$ ls -ld tmp



The main reason for setuid is fairly obvious - to allow something to run under the permissions of the owner when invoked by someone else. For setgid, its normally used to enforce consistency of file group ownership within a directory - i.e. so that all files retain the same group owner irrespective of who created them and what other group memberships tey might have. See also --> .



Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top