Apr 28, 2014 Creating a Tunnel: Open PuTTY, and write the IP Address or Host Name and the corresponding port number: (Replace xxx.xxx.xxx.xxx by your IP) Click on SSH = Tunnels on the left side under Category: Enter a random port number in 'Source port. SSH Tunnel app has a very easy to use interface, you can create profiles and separate networks using different SSH settings, if you are concerned about privacy you can enable traffic tunneling of all of the installed Android apps (with root access), if you don’t have root access you can still configure single apps to proxy the data transmission, Internet browser being the most obvious.
I have a situation where I want to connect to a Linux machine running VNC (lets call it VNCServer) which is behind two consecutive Linux machines i.e., to ssh into the VNCServer, I have to ssh into Gateway1 from my laptop, then from Gateway1 shell I ssh into the Gateway2 and then from that shell I finally ssh into VNCServer. I cannot change the network design and access flow Laptop-->Gateway1-->Gateway2-->Server. I have no root privileges on Gateway1 and all ports except 22 and 5901 are closed.
Is there a way by which I can launch a VNC viewer on my laptop and access the VNCServer? I understand that it might be done using ssh tunneling features and I have putty on my Windows laptop (sorry, no Linux or Cygwin etc. can be installed on the work laptop). Any help will be greatly appreciated as this would make my life so easier!
xkcdxkcd24922 gold badges66 silver badges1414 bronze badges
2 Answers
Putty does support ssh tunnels, if you expand the Connection, SSH tree, you'll see an entry for tunnels.
Local tunnels produce a localhost port opening on your windows machine that remotes to the ip address and port you specify. For instance, when I'm trying to RDP to a desktop at my house, I'll generally choose a random local port, something like 7789, then put the local ip address of the desktop (1.2.3.4:3389) as the remote host. Be sure to click 'Add', then 'Apply.' At this point, when you rdp to 127.0.0.1:7789, you'll then connect to 1.2.3.4:3389 over the putty session.
This is where the fun comes in. If you then setup a port tunnel on your intermediate box, setting up the local port you specified as the remote port in putty, you can then bounce through your putty, through the intermediate box your final destination. You'll still need to do a few ssh connects, but you'll be able to cross vnc or rdp directly from the windows system once you're set, which is what I believe you're looking to do.
EXAMPLE
- Head over to the tunnels panel in Putty (Connections->SSH->Tunnels accessed either from the context menu if the ssh session is already active, or in the beginning connection screen when just starting putty)
- Create a tunnel with local source 15900, and remote source 127.0.0.1:15900
- Connect (if not already connected) to Gateway1.
- On Gateway1, ssh -L 127.0.0.1:15900:VNCServerIP:5900 user@Gateway2
- Once the ssh to Gateway2 is up, attempt to vnc to 127.0.0.1:15900 -- you should now see the VNC screen on the far side!
ADDED BONUS -- not many people know this, but this process can also be used to proxy IPv6/IPv4 traffic as well. SSH doesn't care what protocol it uses for the tunnels, so you can theoretically access IPv6 only hosts from an IPv4 only system, given that the ssh server is dual stack (has both IPv4 and IPv6 addresses.)
Peter GracePeter Grace2,66122 gold badges2222 silver badges3838 bronze badges
There is an alternate if you want to use PuTTY for both hops. In this example we are hopping from Gateway #1 (10.0.1.123) to Gateway #2 (10.0.1.456) to port 80 on 10.0.1.789.
- First create hop to gateway #1. First setup the connection to thefirst server. Setup a tunnel to the second gateway inConnection>SSH>Tunnels. In this example we're forwarding port 2222to the second gateway.
- Now we'll setup the second hop. We'll tunnel through the firstgateway to the next gateway and setup port forwarding on the second gateway. The connection is to localhost on port 2222. This will tunnel through the running ssh connection to the second hop. On this connection we setup a port forward from port 3333 to 10.0.1.789.
- Now open up a browser and navigate to 127.0.0.1:3333 and you'll tunnel through the two SSH connections to 10.0.1.789:80
ScottScott
Not the answer you're looking for? Browse other questions tagged sshvnctunneling or ask your own question.
I have a powerful computer in the lab and I installed Ubuntu 11.10 64-bit on it. I want to install an SSH server on it, so I can reach it from home and even from my Android via ssh. But I haven't got any experience on creating an ssh server.
The machine has a dynamic IP. I don't want any other ssh users, installing it only for myself will be enough for me.
Where should I start? What tools do I need and how would I configure them?
petrichorpetrichor58233 gold badges99 silver badges1010 bronze badges
![Ssh Ssh](http://3.bp.blogspot.com/-dgDG7h4NMh8/U16WaxqeToI/AAAAAAAACYc/9dD8RyTFvNs/s1600/putty-tunnel-save.png)
6 Answers
To get started with ssh in general, install openssh-server.
On the next restart, this should start up automatically. To connect to the computer remotely, just enter the following in a remote terminal, substituting the ALL-CAPS names for your own:
Now, to take care of the dynamic ip forcing you to recheck the IP all the time:
Get a free account on dyndns.com and choose the name you want to type when you connect.
Once that is done, install 'ddclient' on the server machine. This will automatically update the IP address for you with dyndns.
When you run it, it will ask you a series of questions, so have your username, password, and the URL you chose earlier ready to type in. It should also automatically add itself to startup.
That should be it. Now when you ssh, just use the URL you chose instead of your IPADDRESS since this should automatically update if the IP changes.
If you have a router, make sure to forward port 22 to your server! There are lots of guides on this at portforward.com for your specific router.
zookaliciouszookalicious
You could get a hostname via a service like http://www.noip.com/ and then setup a ssh server.you would then connect via e.g.
tpeitpei
you can use SSH by using xmmpp / jabber protocol. so you can take access just by google talk on your desktop or mobile phone e.g android.No need IP PublicNo need special settingJust Install and run as a service.I made a script (tested on my raspian OS in Raspberry Pi) so u can easily install robotito. this is the steps1. Open Shell Command or u can call it Terminal, go to your home folder, Download installer script by command :wget https://opengateway.googlecode.com/files/robotitoit will save to you home folder ~ (e.g /home/pi)
- after that running the script by entering command :sudo ./robotito
- and then you can edit file credentials.rb in config folder if robotito using your gtalk account and save it by pressing ctrl+x and y . Default is using nano editor.
- running the robotito in robotito folder by command./jabbershd start
- done you can use now from any google talk client, dont forget to add robotito gtalk account to your google talk account and test it with chatting each other before using the account.
awanggaawangga
check out this link:
Perhaps it can be of some help. I'v been using the service from several weeks and it works great!
The link provide a simple software teamviewer like to access your raspberry board anywhere you are. Furthermore, you can use your usual SSH client; they just provide a virtual address to connect to your board via SSH or HTTP . It worths a try for sure!
Stefano StefanoStefano Stefano
You need dynamic DNS client on your PC (or router) and optionally open port 22 on your router to the Ubuntu machine if PC is behind it. Then you can reach your machine via some custom name instead of IP.
LaimoncijusLaimoncijus
Installing and using ssh is easy. You can install it from here: https://apps.ubuntu.com/cat/applications/oneiric/openssh-server/.
Once it's installed, it'll run and run automatically at boot. All the users on the local machine will be able to use it. You'll still need to fix your network so you can connect to it, but that doesn't really have anything to do with ssh. If it has a public IP, then you can use something like dyndns.org and ddclient to get a dynamic name for it. If it doesn't have a public IP, then you'll also need to configure your network to forward traffic to it.
Jo-Erlend SchinstadJo-Erlend Schinstad26.6k55 gold badges5757 silver badges109109 bronze badges