|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Help With Sudo Please!!
Heres what I want to do with sudo: i want to be able to call a shell or php script from a php script that will log into sudo using -S using the password stored in the file and then execute a script as root. I would chmod the shell or php script to execute only and if someone hacked through php's safemode and executed that script it wouldn't make any difference because it doesn't do any descrutctive. I would like to get any comment and help on this. I have sudo installed but I can't figure out how to access it with -S??? any help is greatly appriciated
|
|
#2
|
|||
|
|||
|
Quote:
if someone hacked through php´s safemode, he´s probably skilled enough to get read permissions to your file too... for your problem: start sudo using: $fp=popen("sudo -S"); then use fputs() to send the password to it: fputs($fp, "your password"); i didn´t test this, but this should work.
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
||||
|
||||
|
Great, thanks, that was what I was looking for but now I'm having another problem maybe you can help me out with. I can't seem to call up sudo and make it work. I'm trying to use sudo -l as a test to display the user's privligaes, but I can't make it to anything. I can't figure out how to call sudo from a PHP withough the file permissions getting mad. Has anyone done this before?
Thanks, Dan |
|
#4
|
||||
|
||||
|
Knowing the output might help you. Make sure that /etc/sudo.conf (or something like that) is setup properly.
__________________
Words must be weighed, not counted. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Help With Sudo Please!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|