Had a problem with ssh login for some time now – it was taking way too long to connect to our staging machine. Normally it’s not a problem – after all, you connect once and work for all day.
But for rsync and git push this is annoying. Everytime you git push you have to wait almost a minute. Reminds me of days I was using SVN
Today I had enough of that and decided to fix the problem.
First, I put ssh client into verbose mode:
ssh german@dev-server -v
Turned out that it was stalling after trying gssapi-with-mic authentication method. Had several “Unspecified GSS failure” messages with several seconds delay between them.
Well, I am using publickey for authentication anyway, so I needed to disable gssapi auth.
There are two ways to do that:
Fix #1: pass an option when trying to connect
ssh -o GSSAPIAuthentication=no german@dev-server
Fix #2: add a line to your ~/.ssh/config
... GSSAPIAuthentication=no ...
I prefer second method, because this way you don’t have to configure every program that connects to SSH to use those options, they will all just work (rsync, git, Nautilus)
Hi, I have faced this issue as well. thanks for solution, it helped me!
JJJ
Thanks for this, I’d tried editing it in the sshd_config file but for some reason it just wasn’t taking. This solved my problem.
Thanks German! Hassled with kerberos conf and hosts file to no avail… And the solution was so simple!