1846972 Members
4249 Online
110257 Solutions
New Discussion

Re: Set uid

 
SOLVED
Go to solution
brian_31
Super Advisor

Set uid

Hi Team:

I need to change the permission on a binary from
---S--S--x sproot
to s (small s). I think there is a difference between the S ans s in setuid and setgid. Can someone help here to understand the difference and also suggest the method to change the permission to may be ---s--s--x. Please help.

Thanks
Brian.
4 REPLIES 4
Sajid_1
Honored Contributor
Solution

Re: Set uid

hello,

there is actually no difference in the setguid and setuid values. The difference in S and s is the 'x' value. If you have both 'x' (x in 'rwx') and 'S' is set, then when you display, it will list as - 's'. If only 'S' is set without 'x', then it will display 'S'.

HTH
learn unix ..
S.K. Chan
Honored Contributor

Re: Set uid

The "x", executable bit determines whether "S" or "s" will be display. Take for example.
# touch fileA
# chmod 6001 fileA
==> That gives ---S--S--x
# chmod 6111 fileA
==> That gives ---s--s--x
Sajid_1
Honored Contributor

Re: Set uid

Hi again,

For more explanation, an eg: to try:
# cd /tmp
# touch test
# ls -al test
-rw-rw-rw- ....test
# chmod 4666 test
# ls -al test
-rwSrw-rw-
# chmod 4766 test
# ls -al test
-rwsrw-rw-

Look at the difference between both 'ls' commands

hth,
learn unix ..
Mark Greene_1
Honored Contributor

Re: Set uid

chmod 6111 will set the permissions to --s--s--x which means that the execute and the setuid bits are both set on owner and group.

The upper case "S" is the setuid bit without execute permissions, and the lower case "s" with the setuid bit with execute permissions.

HTH
mark
the future will be a lot like now, only later