I'm trying to use ssh to connect my home PC to the Internet via my work PC which has an Internet connection, but I don't seem to get it right.

I'm using Putty to try and establish a connection between the two computers but unsuccessfully, is there a way I can get around this?

  • 1. You know you need to connect to your work PC via the internet, right? 2. Are you sure that the SSH server is accessible from outside your work LAN? It's very insecure, though. – GiantTree Mar 8 '16 at 17:48
  • Yes, my work pc is connected to the Internet and I'm not sure whether the ssh server is accessible outside, I'm using the putty distribution and also tried bitvise ssh client. – user15171 Mar 8 '16 at 17:55
  • @user15171 you missunderstood GiantTree what he tries to point out to you is that to actually beeing able to setup an ssh connection your HomePC needs to have a working Internet Connection. – konqui Jul 5 '17 at 10:56
  • From user Valentyn: Here is a very good answer to your question if you have ssh access to the work machine. – fixer1234 Nov 17 '18 at 0:52

You need to take a look at your port forwarding: SSH uses port 22, and you need to set up your router(s)/modem with the necessary port forwarding rules so that this port is forwarded to the IP your home PC have on the LAN.

I cannot give a more detailed explanation without any info, but you can find many resources here: http://portforward.com/


What operating system is the SSH server at work you are trying to access using? If there is host-based firewall software on your work system, e.g., Microsoft Windows firewall software or a host-based firewall that may be part of an antivirus and security package, e.g., if it is a Windows system or, perhaps,iptables, if it is a Linux system, you will need to configure that firewall software to allow incoming connections on TCP port 22, the standard port used by Secure Shell (SSH) connections, assuming that the work system is functioning as an SSH server listening on the standard port. If you have access to another system at your work location and can put SSH client software on it, e.g., PuTTY, you can test that there is no host-based firewall software blocking access to the system that is functioning as the SSH server from any IP address, though it the firewall software could still be configured to grant access only from certain systems on the LAN and not accessible from any IP address on the Internet.

Your work LAN will have a router/firewall at the demarcation point between that LAN and the Internet. That router or firewall will need to have a firewall rule set to allow incoming connections on port 22, again assuming your work system is listening on the standard SSH port, to reach your work SSH server. Unless you work for a large company or organization, I'd suspect that you have private IP addresses in use on the LAN. You can check that by determining if the IP address of your SSH server is in any of these IPv4 private IP address ranges. If so, then the router/firewall will need to perform network address translation (NAT) to translate an external IP address for the firewall router to the one for the internal SSH server. The exact procedure for performing the needed translation, so that the incoming SSH connection is routed to your work system will depend on the manufacturer and model of the firewall or router that needs to be configured. If there is some other SSH server at your work location that needs to be accessible on the standard port, port 22, you will need to reconfigure the system you wish to connect to so that it listens on another port, if your work location has only one public IP address.

You can test if there is some server accessible via port 22 at the work location, by using an external test tool. There are many sites on the Internet that will allow you to scan for open ports or test connectivity to a particular port or ports. E.g., you could use the Port Forwarding Tester. Put in the externally visible IP address of your system at the work location, i.e., the one that systems on the Internet see, which you could determine by visiting a site such as WhatIsMyIP using a browser on a work system, and the SSH port, port 22. That tester will at least show you if there is some system listening on port 22 at the work location that is accessible from the Internet. If only the system you wish to reach is functioning as an SSH server at the work location, then you've determined if it is reachable. But it is possible that the router/firewall is itself configured to be accessible externally via SSH, so getting a positive answer doesn't necessarily imply that you are communicating on port 22 with the system you wish to reach. But a negative answer, i.e., no response on port 22, may indicate that a firewall rule or port forwarding needs to be configured on the router/firewall.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.