LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2010, 11:16 PM   #1
twaddlac
Member
 
Registered: Jun 2010
Posts: 34

Rep: Reputation: 0
Unhappy Reverse SSH Tunnel Ubuntu and Windows 7


Hello,

I am currently running 64-bit Windows 7 from my home laptop and I would like to establish an SSH reverse tunnel to my laptop from my work Ubuntu 64-bit machine. I have been reading many "tutorials" that have led me nowhere and I feel as though I'm chasing my tail now. I have done the following on my Ubuntu machine:

Code:
ssh -R 19999:localhost:22 laptop_ip
and on my Windows machine, using putty, did the following:

Code:
Host Name: host_IP

#under SSH>Tunnels tab
source port: 20000
destination: localhost:19999
destination: Dynamic
I am able to access my Ubuntu machine when on my work network but there I have been unsuccessful when it comes to trying to remotely access it. I have tried everything that I can think of (though I am a novice). If there is any help/suggestions/ideas that could help, please let me know and don't hesitate to ask for more info! Thank you in advance!

p.s. I would also like to enable x-forwarding, but for now I would like to have remote access to the Ubuntu machine.
 
Old 10-04-2010, 12:39 AM   #2
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
it sounds like you want to connect to a workstation at your office from your house.
It also appears that you have been able to connect to your own sshd from localhost (your workstation).

You may want to look at local filtering rules in iptables. Also, if your behind a router at your office there is a good chance that port 22 is filtered / blocked.
YOu will need to speak with admin for your office network to see if thats the issue. the same thing goes for your home connection, check your router/modem to see if it is blocking traffic to port 22.
 
1 members found this post helpful.
Old 10-04-2010, 03:49 PM   #3
twaddlac
Member
 
Registered: Jun 2010
Posts: 34

Original Poster
Rep: Reputation: 0
Quote:
there is a good chance that port 22 is filtered / blocked.
Thank you! It turned out that my firewall on my windows machine was blocking the port 22. I fixed it by:

Control Panel > System and Security > Windows Firewall > Advanced Settings > Inbound Rules (top left of window, found in left column) > New rule (Top right of window, in left column) > port > Specify Port (in my case, port 22) > Allow Connection > name (whatever you feel like) and it worked!

Unfortunately I haven't been able to get the reverse tunnel to work, but this is one problem down!
 
Old 10-04-2010, 09:16 PM   #4
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
Talking

Ok,

here is a picture of how your connection is going.

Work-station Work-Router Home-Router Laptop
1 >>>>>>>>>>>>>>>>>>> 2 >>>>>>>>>>>>>>>>>>> 3 >>>>>>>>>>>>>>>>> 4


Location #1
  • Must have the daemon running
  • Must allow in/out-bound connetions to service ( port 22 )

Location #2
  • Must allow in/out-bound connections to service ( port 22 )
  • To start the connection to the daemon on the workstation you will need to have port forwarding configured
  • Some office/ production routers also block out-bound traffic based on service-port, make sure its allowed.

Location #3
  • Must allow OUTBOUND for service at port 22

Location #4
  • Must allow OUTBOUND for service at port 22
    you appear to have already addressed this in your win7

Quote:
  • So, this assumes that your connection will originate from a client on the laptop behind the home router.
  • This DOES not allow for connections from WORKSTATION to LAPTOP
  • You can also open the home router and laptops for in-bound
  • All of this information can be found with google if you need to get more detailed]
  • YMMV
 
Old 10-05-2010, 10:43 AM   #5
twaddlac
Member
 
Registered: Jun 2010
Posts: 34

Original Poster
Rep: Reputation: 0
Thanks for the helpful figure!

Quote:
# So, this assumes that your connection will originate from a client on the laptop behind the home router.
# This DOES not allow for connections from WORKSTATION to LAPTOP
I guess I should have specified in my original post, I would like to establish a reverse tunnel to get around the firewall that my work pc is behind (which doesn't allow incoming connections). In that case, wouldn't the work computer have to establish the connection to the laptop?
 
Old 10-05-2010, 05:46 PM   #6
mrmnemo
Member
 
Registered: Aug 2009
Distribution: linux
Posts: 527

Rep: Reputation: 51
While I am sure others here will be able to give you solution, I am un able too. I dont know how to have sshd ( workstation ) initiate a connection to a client ( laptop ). You might try googling for it. However, if the individual in charge of the network does not wish to have this traffic and you find a hack/workaround and get caught....bad juju.
 
Old 10-06-2010, 11:27 AM   #7
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Well I do not condone getting around installed safeguards on your company network, from a theory standpoint I would say that your options would be to run the SSHD daemon on a port that is allowed through the firewall or run an SSH server on your home machine, I believe that the reason it is not working is because you do not have an SSH server running one the computer you are connecting to.

With all of that said why don't you ask your IT guy about VPN access, or ask your boss about it. If everything is on the up and up then this shouldn't be an issue to ask about it.
 
  


Reply

Tags
remote login, ssh tunnel, ubuntu, windows7



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
[SOLVED] Reverse SSH tunnel edan Linux - Security 3 07-14-2010 09:37 PM
LXer: remote control android, a reverse ssh tunnel LXer Syndicated Linux News 0 05-18-2010 10:50 AM
Reverse SSH tunnel active only from localhost andreag Linux - Networking 2 12-19-2006 02:05 AM
SSH reverse tunnel (lo only? why not eth0) Dinomight Linux - Networking 3 08-17-2006 09:44 PM
Reverse SSH Tunnel sniggleflop Linux - Security 1 10-13-2002 01:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:14 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