SunQuest
           Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 15th, 2003, 08:22 PM
x51's Avatar
x51 x51 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 95 x51 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 5 sec
Reputation Power: 6
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
__________________
C:\DOS C:\DOS\RUN RUN\DOS\RUN
http://www.dandland.com

Reply With Quote
  #2  
Old February 18th, 2003, 03:24 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Quote:
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

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.

Reply With Quote
  #3  
Old February 23rd, 2003, 12:30 PM
x51's Avatar
x51 x51 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 95 x51 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 5 sec
Reputation Power: 6
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

Reply With Quote
  #4  
Old February 24th, 2003, 10:54 AM
riv's Avatar
riv riv is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 463 riv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 50 sec
Reputation Power: 8
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Help With Sudo Please!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway