1836636 Members
1561 Online
110102 Solutions
New Discussion

Stickby Bit Change Mode

 
SOLVED
Go to solution

Stickby Bit Change Mode

Dear All,
please assist me on how could I run a super user (root) command using my normal id.
I got the messages below :
user id was not superuser
must be superuser to execute

Please help.
5 REPLIES 5
Devender Khatana
Honored Contributor

Re: Stickby Bit Change Mode

Hi,


The long listing of your file should look like this if sticky bit is set. To set it give

-rwxr-xr-t 1 root sys 12 Jun 28 08:55 test

#chmod u+t filename

To Remove

#chmod u-t filename

HTH,
Devender
Impossible itself mentions "I m possible"
Patrick Wallek
Honored Contributor

Re: Stickby Bit Change Mode

A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Stickby Bit Change Mode

This is not the function of the sticky bit but rather the setuid bit.

1) The file must be owned by root.
2) You then set the setuid bit by or'ing Octal 4000 with the lower 9-bits. e.g. chmod 4755 myfile.exe

Hovewer, if you do this as an ordinary user:
chmod 4755 myfile.exe
chown root myfile.exe
the setuid bit bit will be cleared; otherwise, there would be a huge security hole.

Even if you carry out the above steps in the correct order that is still no guarantee that the process will execute as root because the other condition is that the setuid() system call must be employed in the program itself.

If this is a shell-script then setting the setuid bit will do the job although such shell scripts are huge security risks.

The better answer is to download and insta;; the "sudo" utility from any of the HP-UX Porting Centre's. This utility will do the trick for you even if the underlying program does not employ the setuid() system call.


If it ain't broke, I can fix that.

Re: Stickby Bit Change Mode

Thank for your replies.

To update,
As Devender Khatana advise to chmod u+t filename. The command is work but still I can't run the superuser command.

As A Clay Stephenson advices, it works. Now my normal Id can run the super user command.

As Patrick advised to use sudo. It look great but still need to further explore as I'm not yet familiar with the sudo.

By the way, Thank to all for the help.

Regard
- Kamarul

Re: Stickby Bit Change Mode

Thanks for all prompt replies.
This forum is very usefull for me.