LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 11:43 AM   #1
shams
Member
 
Registered: Jan 2004
Posts: 535

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, 06:50 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 07:00 PM   #3
shams
Member
 
Registered: Jan 2004
Posts: 535

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, 07:34 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

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

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



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 09:21 AM
ssh tunnel not working abefroman Linux - Server 1 01-16-2010 02:37 AM
SSH Tunnel script for DB connections philosophia Linux - General 2 09-01-2006 12:06 PM
Strange problem - mysql not working through ssh tunnel ganz_friedrich Linux - Software 0 03-31-2006 08:45 AM

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

All times are GMT -5. The time now is 02:31 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
Open Source Consulting | Domain Registration