I've got a fresh install of 16.04.3 desktop with openssh installed. I can connect to ssh on the same machine, but not across my internal network. ufw is inactive.

The server host cannot be pinged by other hosts on my local network. It also cannot ping other hosts on the local network. The server host is able to be ping google.com, yahoo.com, etc.

What am I missing to get ssh to work remotely?

  • 2
    what is the difference between " I can connect with ssh in term" and "not across my internal network" ? If you can connect , the ssh server is working and either you have something mis configured, ssh keys ? , or network problem such as port forwarding. Can not really tell from what you posted. – Panther Sep 21 '17 at 3:01
  • In term on the local machine I can ssh, from any other machine I cannot connect. – George Sep 22 '17 at 12:35
  • 1
    Hard to tell, if you can connect on the local machine the ssh server is working. It is most likely a problem with your firewall or you did not port forward. Start with ping and checking your firewall settings. – Panther Sep 22 '17 at 13:20

Usually when i need to access my Linux machine from ssh remotely, i just install ssh with sudo apt-get install ssh and by default it does what i need it to do. Connect via ssh from any PC.

Ubuntu also has their documentation on configuring openssh. https://help.ubuntu.com/community/SSH/OpenSSH/Configuring

  1. Install openssh, sudo apt-get install openssh-server
  2. Backup the default config, sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults then sudo chmod a-w /etc/ssh/sshd_config.factory-defaults
  3. Make any changes that you like, sudo gedit /etc/ssh/sshd_config. Check the openssh/ssh man page for instructions on configuring sshd_config
  4. Remember to restart the service to apply changes, sudo restart ssh or sudo systemctl restart ssh
  5. You can also make sure the ssh port is open on iptables. I almost never have to do this but if you need to. sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
| improve this answer | |
  • I tried adding the step 5. The first four were the same, but it did not seem to have any effect. – George Sep 22 '17 at 19:58
  • Just to clear this up, you are connecting "remotely" as in a local computer on your network, right? If so, make sure you can ping the machine you are trying to SSH into. Also on the linux machine with openssh, run in a terminal netstat -lt4 | grep ssh and make sure your machine is listening for SSH connections. – xR34P3Rx Sep 22 '17 at 20:05
  • netstat -lt4 | grep ssh resulted in tcp 0 0 :ssh *: LiSTEN – George Sep 23 '17 at 0:33
  • ok, so you are fine on your machine. How are you connecting to the machine from the remote machine? Are you running this on a vm by any chance? Run ifconfig on your openssh machine and post the results, it might just be an IP issue. As well as the ip results of the remote. (if its windows, ipconfig. – xR34P3Rx Sep 23 '17 at 0:38
  • wlan0 Link encap:Ethernet HWaddr 94:a1:a2:fa:cd:4b inet addr: Bcast: Mask: inet6 addr: fe80::bb09:7089:9590:9db/64 Scope:Link inet6 addr: 2602:30a:c7d3:4160:7a8c:f33:cf3:511d/64 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:112420 errors:0 dropped:0 overruns:0 frame:0 TX packets:75371 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:103416133 (103.4 MB) TX bytes:10985078 (10.9 MB) – George Sep 23 '17 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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