1752301 Members
4679 Online
108786 Solutions
New Discussion юеВ

chmod 4000 and 4600

 
SOLVED
Go to solution
VEL_1
Valued Contributor

chmod 4000 and 4600


Generally to set sticky bit, we will use like:

# chmod 4100 test.txt
# ll test.txt
---s------ 1 root root 462 Jan 28 09:22 test.txt

# chmod 4700 test.txt
# ll test.txt
-rws------ 1 root root 462 Jan 28 09:22 test.txt

But in the following, What is "S" indicate in the sticky bit field??

# chmod 4000 test.txt
# ll test.txt
---S------ 1 root root 462 Jan 28 09:22 test.txt

# chmod 4600 test.txt
# ll test.txt
-rwS------ 1 root root 462 Jan 28 09:22 test.txt
4 REPLIES 4
Dexter Filmore
Honored Contributor
Solution

Re: chmod 4000 and 4600

I think the "S" indicates that the execute bit is not set, whereas the "s" in the first example indicates that the execute bit is set.

Claudio Cilloni
Honored Contributor

Re: chmod 4000 and 4600

"sticky"? I thought that the 's' bit means "superuser"...

ciao
Claudio
HGN
Honored Contributor

Re: chmod 4000 and 4600

Hi

#chmod 4000 sets the User ID on file execution
#chmod 2000 sets the group ID on file execution

so s gives the execute permission, so when u set a group to execute, the people in that group can all execute that file.
You can the passwd file each user can execute it to change his own passwd(that has user id on execution).

Rgds

HGN
Stuart Browne
Honored Contributor

Re: chmod 4000 and 4600

Claudio is right. 's' or 'S' is suid-execute, not sticky. 't' is sticky (1xxx or 'chmod +t').
One long-haired git at your service...