LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-17-2013, 12:43 PM   #1
shams
Member
 
Registered: Jan 2004
Posts: 468

Rep: Reputation: 30
Question 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.
 
Old 11-17-2013, 07:50 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Quote:
Originally Posted by shams View Post
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...
 
Old 11-17-2013, 08:00 PM   #3
shams
Member
 
Registered: Jan 2004
Posts: 468

Original Poster
Rep: Reputation: 30
Thanks for reply, but i didn't know any thing about using public keys and how to use for auth?
 
Old 11-17-2013, 08:34 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Start with 'man ssh-agent'?
 
Old 11-18-2013, 10:05 AM   #5
shams
Member
 
Registered: Jan 2004
Posts: 468

Original Poster
Rep: Reputation: 30
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>';
?>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh ftp tunnel, not working - cannot list dirs LBM Linux - Networking 9 08-23-2012 10:21 AM
ssh tunnel not working abefroman Linux - Server 1 01-16-2010 03:37 AM
SSH Tunnel script for DB connections philosophia Linux - General 2 09-01-2006 01:06 PM
Strange problem - mysql not working through ssh tunnel ganz_friedrich Linux - Software 0 03-31-2006 09:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration