published on in Tech Tips & Tricks

Struggling with SSH login delays

You know, it really sucks when you log into a machine and for some reason there is a delay before the connection is fully functional. This happend to the SSH of a server to which I frequently connect, delaying my connections for 8 to 30 seconds. Again it sucked, up to a degree where I decided to track down the issue and fix it. Google told me, it’s reverse DNS mappings and I should set UseDNS no in the sshd_config, but that didn’t work (and besides, reverse DNS can’t be that slow…).

So running /usr/sbin/sshd -d showed me, that it’s hanging while the pam login is performed. But no hints from that. Running sshd in strace showed me it’s polling from /var/run/dbus/system_bus_socket. So I restarted dbus and the issue was fixed. I don’t know though how it came to the problem in the first place.