LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 10:46 AM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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, 11:50 AM   #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 11:54 AM.
 
Old 08-26-2012, 01:18 PM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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 01:42 PM. Reason: Added fix to problem
 
Old 08-26-2012, 02:06 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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