LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ssh tunnel with php script not working? (https://www.linuxquestions.org/questions/linux-software-2/ssh-tunnel-with-php-script-not-working-4175484915/)

shams 11-17-2013 11:43 AM

ssh tunnel with php script not working?
 
I want to create a ssh tunnel with php script but it is not working:

Quote:

<?php
exec ('sshpass -p my_pass ssh -L 9001:remote_server:80 user@shell.example.net -N');

echo '<b> Done </b>';
?>
just print the Done.

unSpawn 11-17-2013 06:50 PM

Quote:

Originally Posted by shams (Post 5066197)
it is not working

...and luckily so. At this point please (re-)read the "Security Considerations" section of the manual page, (re-)read this products home page with respect to using ssh-agent + pubkey auth and try to come up with (at least) a less insecure way...

shams 11-17-2013 07:00 PM

Thanks for reply, but i didn't know any thing about using public keys and how to use for auth?

unSpawn 11-17-2013 07:34 PM

Start with 'man ssh-agent'?

shams 11-18-2013 09:05 AM

I did the steps and now can login without password but the script still not working:
Quote:

<?php
exec ('/us/bin/ssh -L 9001:remote_server:80 user@shell.example.net -N');

echo '<b> Done </b>';
?>


All times are GMT -5. The time now is 10:20 AM.