Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-14-2010, 02:29 PM
|
#1
|
LQ Newbie
Registered: May 2006
Posts: 13
Rep:
|
Reverse SSH tunnel
Does anyone know if it is possible to make the remote port in a reverse SSH tunnel listen on the regular network interface of the SSH server, and not just the loopback adapter on the remote system? The client is putty on a Windows machine, server is Ubuntu based (but can go with another OS if needed).
I basically need a system located on the same network as the SSH server to connect to a TCP port on the system that's running the SSH client. No matter what I do, I can only get it to listen on localhost. Thanks!
|
|
|
07-14-2010, 02:53 PM
|
#2
|
Member
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 184
Rep:
|
man ssh
option -R shows that it is possible with a limitation on the server side where it has to listen the 'GatewayPorts' must be enabled in the sshd_config file.
Off course there is a way to get around this for ports above 1024 (unless you can login as root)
ssh -R 2020:localhost:20 server
# this creates a reverse tunnel from server to client
ssh -P 2020 -g 5900:localhost:5900 localhost
# make a connection from the server to the client via that reverse tunnel
both lines above contain localhost but that refers to the 'other host'
I didn't test this hack but I don't see why it wouldn't work.
The -g allows other host to connect to the port without having access to the sshd_config on that server.
|
|
1 members found this post helpful.
|
07-14-2010, 08:11 PM
|
#3
|
LQ Newbie
Registered: May 2006
Posts: 13
Original Poster
Rep:
|
Thanks, GatewayPorts is exactly what I needed!
|
|
|
07-14-2010, 09:37 PM
|
#4
|
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305
Rep:
|
Dear Edan,
Please mark this thread as SOLVED if your problem is resolved. You can see my signature for the exact steps.
|
|
|
All times are GMT -5. The time now is 10:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|