Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have noticed that some Linux Servers in Network takes long time to connect using ssh.

Situations:

There are two situations I have faced:

  1. On some servers some times it takes a long time to ask for password

  2. but on other servers When I insert the password it doesn't respond . And after some time say 20 0r 30 seconds it just say Connection Closed

Detail for 1 case:

debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Trying private key: /home/umairmustafa/.ssh/id_rsa
debug1: Trying private key: /home/umairmustafa/.ssh/id_dsa
debug1: Trying private key: /home/umairmustafa/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
share|improve this question
1  
Please include the last few lines from running with ssh -vv when it's taking a long time to respond. Also, if you have access to the server logs, the entries from your connecting will probably be helpful as well. As the question stands, any answer can only really be guesswork. –  Michael Kjörling Feb 17 '13 at 12:05
    
Updated Question. –  OmiPenguin Feb 17 '13 at 13:21
    
Much better now. I don't have an answer, but it's plenty more answerable with the additional information. +1. –  Michael Kjörling Feb 17 '13 at 14:00
    
possible duplicate of How to speed my too-slow ssh login? –  jasonwryan Feb 18 '13 at 0:29

2 Answers 2

up vote 14 down vote accepted

I had this same problem just this morning...

Edit your /etc/ssh/sshd_config to set GSSAPIAuthentication no

share|improve this answer
    
yes, this worked good –  Silver Moon Mar 15 at 5:12
    
I had to run /sbin/service sshd restart after the edit to get this to work –  ContextSwitch Jul 18 at 18:37

Often this happened to me when DNS was not correctly configured, but SSH is trying to do a reverse lookup on every connect, so it might be waiting for some high timeouts. Try doing this in /etc/ssh/sshd_config:

UseDNS no

And then restart the SSH daemon. This will make it not use reverse lookups anymore.

Hope that helps.

share|improve this answer
1  
That is just papering over a serious problem. Fix DNS. –  vonbrand Feb 17 '13 at 13:19
    
Not necessarily, we just decided to not use DNS in our production environment. –  mauro.stettler Feb 17 '13 at 13:29
1  
Great idea. Just manage /etc/hosts by hand on all your machines. Wellcome back to the good old days of the nascent Internet! –  vonbrand Feb 17 '13 at 13:41
    
I agree with you that in 90% of the cases it totally makes sense to have an internal DNS, just in our particular case it did not. –  mauro.stettler Feb 17 '13 at 13:45
    
@vonbrand Sounds like FUD. What reasoning do you have that UseDNS no is bad? –  Patrick Aug 12 at 16:25

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.