Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 IPs 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: 192.168.1.222:911 <-Port 911 is being forwarded
or
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.

share|improve this question
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. –  bodhi.zazen Jan 8 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 at 23:35
    
did you specify port 911 in putty? –  bodhi.zazen Jan 8 at 23:35
    
Yes, in the box just to the right of the IP address –  doug5791 Jan 8 at 23:38

3 Answers 3

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

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.

share|improve this answer
    
How do I do that? –  doug5791 Jan 9 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 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.

share|improve this answer
    
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 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 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 at 0:25
    
Maybe you should change the config to have password auth allowed? –  Kevin Panko Jan 9 at 1:23
    
How do I do that? –  doug5791 Jan 9 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: http://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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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