Run script as different user<

liunx

Guest
I have looked everywhere to find a way to run some of my scripts as a different user and haven't found a good way of doing it.

I am running a qmail server that has qmailadmin and vqadmin, both of these are web based cgi's that can run as a different user but I cannot find out how they did it. I do not want to use suEXEC as it looks like a very large security risk.

Is there any way to specify what user to run a file as in a .htaccess file? I am making a admin section for a website where I want users to be able to add and modify email address's for their domain, I wanted to write the scripts myself so that they fit perfectly in my admin section.

I know this is possible, the qmailadmin works on this server and I didn't have to setup anything special for it, how can I do the same thing?not familiar with any of those but the only way I can see you able to run as a different user is to have them login and then see if tehy have permissions to run said script. you have to set something up to check this.

qmailadmin works for different users as it is programed to be setup on the server side, not your side. each domain has it setup for them.What I ended up doing was to make a php cli script that does everything I want it to and then I have it listening on a tcp/ip port on the server through xinetd

This lets me run my script as whatever user I want it I can set it up to be pretty secure both in the coding and also though locking it down in the xinetd config.interesting, glad you figured it out.
 
Back
Top