Ubuntu – problems with putty while establishing ssh connection (Ubuntu Server)

puttysshUbuntuubuntu-14.04

since two days I am facing a really weird problem. I have receantly installed ubuntu server 14.04 LTS on a workstation. It has a fix IP address, which I can successfully ping from other computers in the network. But when I try to establish a ssh connection from a windows computer via putty I get some strange errors, which I cannot fix.
The Problem is that putty takes a really long time trying to establish a connection. After about 10 seconds I get the following error:

Network error: Software caused connection abort

But when I click the Restart Session option a several times I can login in. But now comes the other problem. When the login appears on the putty console I type in the user, but it really takes a long time until I can type in the password to login.

This is what I already tried to solve that problem:

  • sshd: ALL in etc/hosts.allow
  • commented line pam_motd.so in etc/pam.d/login and etc/pam.d/sshd
  • configured the firewall with: sudo iptables -A INPUT -p tcp –dport ssh -j ACCEPT
  • already checked if ssh server is running and listening on port 22
  • UseDNS no in etc/ssh/sshd_config (EDIT)

FYI: The network which the server and the rest of our computers are, is the network of our university.
I hope someone can help me with this.
Thanks in regard 🙂

Best Answer

This sounds like it might be the same problem I have experienced. For me it turned out every time someone attempts to login through SSH, the SSH Daemon attempts to perform a reverse lookup. On some networks this causes trouble, and the user has to wait until the DNS lookup times out before he/she can continue.

Add the following line to /etc/ssh/sshd_config and see if it helps;

UseDNS no

Don't forget to restart the SSH Daemon;

service ssh restart