Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ "su"ing Within A Script

Posted by: catbutt Nov 13 2002, 06:32 PM

Ok, another question...I have a script that has to run as root, since it does certain things like restart apache, etc. However, it also needs to start a another program that should run as a user, since running it as root seems a bad idea (it is a server program, and I want to make sure if someone exploits some vulnerability in it they can only do so much damage).

I can't do an "su" within a script, that doesn't work....is there any way to tell the OS to run the program as a non-root user?

I wrote the program that will be running, so I suppose a possibility is to change the user internally to the program, if that is possible, but I don't know that either. (it is written in C/C++)

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)