plink and apache

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to display plink output to webpage but without success.

//$cmd ="sudo plink ";
system("sudo plink");   // output is empty
echo "<Br><Br>";
system("sudo plink -pw 1234 -l root localhost ls /root");   // output
is empty
echo "<Br><Br>";
system ("sudo ls /root");    // directory listing of /root

plink is configured correctly in sudoers:
apache  ALL= NOPASSWD:/usr/local/bin/plink
apache  ALL= NOPASSWD:/bin/ls

if i login as apache, i could run "sudo plink -pw 1234 -l root
localhost ls /root".

pls kindly advise.

Re: plink and apache

Quoted text here. Click to load it

Looks like a path issue.  Try using the full path to
sudo and plink orsetting the path in your script.

Robert G. Melson | Rio Grande MicroSolutions | El Paso, Texas
Thinking is the hardest work there is, which is the probable
reason so few engage in it.  -- Henry Ford

Site Timeline