Jump to content

running scripts as users


Recommended Posts

I know this is bad security practice, but is there any way to create a script or program that will store and automatically enter a password? I'm trying to make a PHP script that will run commands locally, but it needs to do it as a different user than 'apache', and obviously there isn't really a way to enter in the password through PHP when the script runs. Basically what I want is some way you can enter the password in a form which will then take it and put it into a shell script or something that will then log in as that user and run. Can that be done?

 

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

I am fully aware that it shouldn't be done. But it's a semi-temporary user created specifically for apache, and I'm not too worried about security, 'cause no hacker can do anything worse to my box than what I do to it myself...lol....

I might be able to find a way around it though. I dunno yet. Is it really THAT difficult though?

 

edit:

Actually, now that I think about it, I might be able to just have it dump the data to a text file and schedule a separate program as root to read and interperet that occasionally. Instant results would be nice, but I suppose they aren't necessary.

Edited by Urza9814
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...