I have two Linux servers running right now. The first one works just fine when I try to connect from PuTTY.

  • Port 22 is forwarded for my working SSH server.
  • Port 911 is forwarded for my not working SSH server

I cannot connect to the second server using the internal IP address or the external IP address. When trying to connect to the internal, I receive this message from PuTTY:

Network Error: Connection Refused.

When I try using the external IP address it will just time out.

The two server IP addresses and other information are listed below.

Working server:
IP: 253.68.xxx.xx:22 <-Port 22 is being forwarded on my router

Not Working server:
IP: <-Port 911 is being forwarded
IP: 253.68.xx.xx:911

I have looked at several posts by other people with this issue, and I have had mixed advice. Some people have advised editing the /etc/ssh/sshd_config file while others have advised against it.

  • 1
    How did you try to connect ? post the command. And yes you need to edit /etc/ssh/sshd_config, change the port to 911, and restart or re-read the ssh server. It is possible your isp is blocking 911, so try 8022 or some such. – Panther Jan 8 '14 at 23:32
  • @bodhi.zazen I am trying to connect via putty. My isp is not block 911, I called them to verify that this port was available. When I change the /etc/ssh/sshd_config port to listen to port 911, restart the ssh service, and try again I get the following error from putty; "Network Error: Software caused connection abort" – doug5791 Jan 8 '14 at 23:35
  • did you specify port 911 in putty? – Panther Jan 8 '14 at 23:35
  • Yes, in the box just to the right of the IP address – doug5791 Jan 8 '14 at 23:38

The error messages from /var/log/auth indicate that the installation of ssh did not complete properly. Host keys do not exist, and without host keys, ssh is unable to initiate user authentication.

You don't mention the flavor of Linux (redhat,debian,gentoo) and each has a different command structure for re-installing the sshd.

My recommendation is to uninstall then re-install the sshd daemon on Linux, then try again. If you get the host key error again, then perhaps your distro requires you to manually create those keys. See the readme file for sshd and that should guide you.


Assuming that the SSH server is listening on port 911 for your non-working server (

It is likely that the firewall on that machine is blocking any incoming connections on that port (911). To resolve this, you will need update the firewall to allow incoming TCP connections on port 911.

  • How do I do that? – doug5791 Jan 9 '14 at 1:28
  • I set the firewall to allow all and I still receive the same error. "Network Error: Software caused connection abort". – doug5791 Jan 9 '14 at 2:05

You must configure SSH to listen on that port. Just forwarding the port on the router does not do this.

On the problem machine, change the /etc/ssh/sshd_config file to have

Port 911

Enable passwords for SSH with this setting:

PasswordAuthentication yes

Restart the SSH service so it will take effect.

  • I have already made this change and restarted the service, now the error message given by putty reads; "Network Error: Software caused connection abort". – doug5791 Jan 8 '14 at 23:41
  • You can check PuTTY's event log to see how far it got in the process. On the Linux side, check the logs there for clues. – Kevin Panko Jan 8 '14 at 23:43
  • This is what my /var/log/auth shows: Jan 8 17:48:53 Phoenixbox sshd[2091]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key Jan 8 17:48:53 Phoenixbox sshd[2091]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key Jan 8 17:48:53 Phoenixbox sshd[2091]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Jan 8 17:48:53 Phoenixbox sshd[2091]: fatal: No supported key exchange algorithms [preauth] – doug5791 Jan 9 '14 at 0:25
  • Maybe you should change the config to have password auth allowed? – Kevin Panko Jan 9 '14 at 1:23
  • How do I do that? – doug5791 Jan 9 '14 at 1:30

I removed the working server from my network and configured the non-working server to listen on port 22 and forwarded the port on the router for this server, it did not make a difference.

After spending a few more hours I found this post: https://askubuntu.com/questions/205179/ssh-problem-read-from-socket-failed-connection-reset-by-peer and it helped my resolve the issue with the following command.

sudo apt-get --reinstall install openssh-server openssh-client

After reconnecting both servers on my network I can SSH to 68.253.xx.xx:22 and end up at the first server and I can SSH to 68.253.xx.xx:911 and end up at the second server.

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.