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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...