LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-26-2012, 11:46 AM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
tunnel ssh over ssh


Hi

I would like to connect via ssh to a 3rd lappy. Home network.
I have a laptop with ssh client which can connect to ubuntu server firewalled then to 3rd laptop with ssh server installed no firewall, ssh port is 1960 on server machines.
I can ssh into server ok and into laptop3 ok I have been trying to go through server then to laptop.
Need to set up forwarding port not sure how to,
I have the server firewall to allow all on local network.

laptop/ssh-client>>>>>server-ssh-FW>>>>>>>laptop3-ssh-server+client
 
Old 08-26-2012, 12:50 PM   #2
iamwilliam
Member
 
Registered: Apr 2006
Location: Nairobi
Distribution: CentOS
Posts: 78

Rep: Reputation: 21
Set up the ssh tunnel as follows
Code:
ssh -p 1960 -fNL 8022:laptop3:22 server-user@server-fw
Connect through the tunnels as follows
Code:
ssh -p 8022 laptop-user@localhost
Hope this helps.

Last edited by iamwilliam; 08-26-2012 at 12:54 PM.
 
Old 08-26-2012, 02:18 PM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi

Still a problem when I run
Code:
ssh -p 8022 spiky@laptop3:22 (I pressume 22 is port for ssh)
I get

"ssh: connect to host 10.42.43.11 port 8022: Connection refused" (10.42.43.11) is 1st laptop.

If I run the 1st command again
Code:
ssh -p 1960 -fNL 8022:laptop3:22 server-user@server-fw
I get

"bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 8022
Could not request local forwarding."

Fixed by changing port number to correct 1

Last edited by spiky0011; 08-26-2012 at 02:42 PM. Reason: Added fix to problem
 
Old 08-26-2012, 03:06 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,127
Blog Entries: 1

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Ok I thought this was solved but it appears not. If I stop ssh on the server I can still connect to the other laptop using
Code:
ssh -p 8022 laptop-user@localhost
Any other ideas plz

The idea was so if I was outside local network I could ssh into server then to other machines on network
 
  


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
Initiate ssh tunnel to connect to ssh? brianmcgee Linux - Security 2 09-07-2011 11:07 AM
SSH Tunnel cryingthug Linux - Security 2 08-22-2011 09:33 AM
ssh tunnel ramesh14 Linux - Newbie 2 12-30-2008 02:11 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 04:15 PM


All times are GMT -5. The time now is 06:30 PM.

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