plink and apache - SSH

This is a discussion on plink and apache - SSH ; I am trying to display plink output to webpage but without success. error_reporting(E_ALL); //$cmd ="sudo plink "; system("sudo plink"); // output is empty echo " "; system("sudo plink -pw 1234 -l root localhost ls /root"); // output is empty echo ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: plink and apache

  1. plink and apache

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

    error_reporting(E_ALL);
    //$cmd ="sudo plink ";
    system("sudo plink"); // output is empty
    echo "

    ";
    system("sudo plink -pw 1234 -l root localhost ls /root"); // output
    is empty
    echo "

    ";
    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.

  2. Re: plink and apache

    In article <07280bf7-af85-4cc0-a319-5b9b5d4005ee@r60g2000hsc.googlegroups.com>,
    aclhkaclhk writes:
    > I am trying to display plink output to webpage but without success.
    >
    > error_reporting(E_ALL);
    > //$cmd ="sudo plink ";
    > system("sudo plink"); // output is empty
    > echo "

    ";
    > system("sudo plink -pw 1234 -l root localhost ls /root"); // output
    > is empty
    > echo "

    ";
    > 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.


    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


+ Reply to Thread