Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 02-04-2009, 08:36 PM   #1
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Rep: Reputation: 30
ssh to a system behind a proxy

Hello folks,
A need has arisen to log into a remote system sitting in a different country. This system is sitting behind a proxy, and therefore does not have a public IP address. I have asked the fellow to start the sshd - it is a linux (fc9) system. But since the system does not have a public IP address, I am not able to ssh into it.

Any ideas ?

-Prahbat Soni
Old 02-04-2009, 10:50 PM   #2
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
The Remote Proxy Server / Firewall will need to be configured to forward the TCP Port. For example you might ssh to port 2345 on the firewall/proxy which will then pass the data onto the real server's port 22. You would still ssh to the public IP address.
The Proxy / Firewall would then in turn handle any NAT'ing to the real IP of the server sitting on the private network.
Old 02-04-2009, 11:12 PM   #3
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Original Poster
Rep: Reputation: 30
But I will give the situation to you in detail.
In fact the remote machine that I am talking to belongs to my brother whom I have just convinced to convert to linux. He does not have knowledge of linux, so I thought perhaps I could help him by loggin into his machine through ssh.
Now this machine is in his office where he connected to a LAN, and he accesses the internet through proxy. The option of configuring the proxy is out of question because he is a small fish in his organisation.
Is there not any other way by which it could be done.

Thanks any way.

Prabhat Soni
Old 02-04-2009, 11:46 PM   #4
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Have him establish an ssh connection to your machine with a reverse tunnel.

He connects to you and establishes a reverse tunnel...
brotherMachine# ssh -R 30022:yourMachine:22 user@yourMachine

From your machine, you ssh to the port that forwards back to his sshd...
yourMachine#ssh user@localhost:30022

Last edited by JulianTosh; 02-04-2009 at 11:48 PM. Reason: typo


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 over proxy eduac Linux - Software 1 04-10-2007 05:41 PM
SSH through proxy? FrayAdjacent Linux - Networking 3 07-10-2005 03:22 PM
ssh with proxy? SiLiCoN Linux - Networking 1 03-14-2005 12:59 AM
ssh via proxy benne Linux - Networking 3 11-22-2004 06:13 PM
Proxy problem: can`t connect SSH through proxy... bugzilla Linux - Networking 3 09-16-2004 10:36 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:11 AM.

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