Operating System - HP-UX
1833011 Members
2565 Online
110048 Solutions
New Discussion

Re: Queries regarding s-bit

 
Amrit Rao
Occasional Contributor

Queries regarding s-bit

I was reading one of the documents when I saw the following text:

If the s-bit is set for the owner or group at the same time that the x-bit is set, for permission to execute, then there will be an s in place of the x.

Does the mean in case the original permission of the s-bit of a executable is 700 and then I change I execute chmod 777 the s-bit would be set.

The main issue that I am facing is that when I am installation a software, I am doing a chmod to the entire directory and the s-bit is getting set. Is this happening during installation of the software would it be set during the compilation stage.
4 REPLIES 4
Amrit Rao
Occasional Contributor

Re: Queries regarding s-bit

Just to add on, in the installation script we have the following command

chmod 4755

I have generally seen only chmod being associated with 3 No's but not 4. What does 4 signify...
steven Burgess_2
Honored Contributor

Re: Queries regarding s-bit

Hi

By executing chmod 777 on a file that already has execute permissions set this will not invoke SETUID or s-bit as you have put.

SETUID is set for owner or group for eg

chmod 4777

or SETGID

chmod 2777

Do you understand the purpose of being able to set these permissions

for eg

when you change your password you modify the /etc/passwd file. Only root has permission to do this. This becomes possible because the /bin/passwd command has the SETUID bit set. so whenever any user executes this command it runs as root and has the privilege to modify /etc/passwd

HTH

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: Queries regarding s-bit

Amrit

You have answered your own question, well done.

The chmod 4755 gives the following permissions to a file

-rwsr-xr-x 1 sburgess admin 13 Sep 26 05:36 testing

HTH

Steve
take your time and think things through
aparna challagulla
Valued Contributor

Re: Queries regarding s-bit

hi Amrit,

the 4th no that u r using with chmod is used to set the setuid bit or setgid bit or the sticky bit
and these are the values used to do so -

Octal Text Name

4000 chmod u+s Setuid bit
2000 chmod g+s Setgid bit
1000 chmod +t Sticky bit

HTH
aparna
If you don't have time to do it right you must have time to do it over