Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing a command as a specific user

Status
Not open for further replies.

stritec

Programmer
Oct 23, 2000
9
0
0
US
Is there a way in PHP to use exec() or something similar that you can pass a user and/or group that the command or application should be run as?

 
I don't think so, cause you cannot run anything in the name of others.

Well, that's not intirely true, in Linux there's a way for a userr to run as another, but that's a security breach.

the files must have mode 4755 this will put a system flag in the file permitions. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
You can only accomplish this if you run your webserver daemon as root which is A VERY BAD IDEA.

Any script or user (including daemons) which are not owned by root, will not be allowed to execute any group commands for groups other than thier own.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I know it's a bad idea ... that's why i say that that was a security breach.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top