Urza9814 Posted February 3, 2007 Report Share Posted February 3, 2007 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] Quote Link to comment Share on other sites More sharing options...
iphitus Posted February 3, 2007 Report Share Posted February 3, 2007 not, can it be done, but should it be done? No. And how it can be done? There's no nice solution, which again implies that it shouldnt be done. Quote Link to comment Share on other sites More sharing options...
Urza9814 Posted February 4, 2007 Author Report Share Posted February 4, 2007 (edited) 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 February 4, 2007 by Urza9814 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.