1833780 Members
2380 Online
110063 Solutions
New Discussion

file charater s.S.t.T

 
SOLVED
Go to solution
singvey
Frequent Advisor

file charater s.S.t.T

thanks:

1.why should we need the file bit :s/S/t/T??
2.what is function of them?
3.How to set bit : s/S/t/T

when I see command manual , I did not understand all about them.
4 REPLIES 4
Bill Hassell
Honored Contributor
Solution

Re: file charater s.S.t.T

The file mode bits sStT are for special purposes. The sS bits are used for setuid and setgid programs. When one of these bits are set (and the file is an executable), the executable runs as if belongs to the user or group. This absolutely require for progams like passwd which everyone must be able to run but the program must have root priviliges to write to the password file.

The T bits are called sticky bits but the only practical use is to set them on directories where everyone has permission to remove or rename everything (such as /tmp) but you don't want anyone but the owner to remove or rename the files or directories.

A good book on Unix will help with the details.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: file charater s.S.t.T

Oh, how to set them: add 1000, 2000 or 4000 to the mode number to set them as in:

chmod 1777 /tmp
ll -d /tmp

You can also use the symbolic (rather than numeric) method too. man chmod


Bill Hassell, sysadmin
singvey
Frequent Advisor

Re: file charater s.S.t.T

---s------ Execute/search by owner; set user ID on execution


is the above line can work as the following lines?

chmod 500 test

ls -al test
-r-x------ .... test


Jdamian
Respected Contributor

Re: file charater s.S.t.T

The effect of set-group-ID in directories is:

In a directory which has the set-group-ID bit set (reflected
as either -----s--- or -----l--- in the output of 'ls -ld'),
files and subdirectories are created with the group-ID of
the parent directory-not that of current process.