• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved [Solved] Delay after login before password prompt in ssh?

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,097
Messages: 26,989

#2
Re: Delay after login before password prompt in ssh?

It's a DNS issue, the server will try to reverse resolve the IP address. If the server has no or a faulty DNS resolving you will get a delay.
 

michaelrmgreen

Active Member

Thanks: 19
Messages: 210

#3
Re: Delay after login before password prompt in ssh?

Hmm, odd, sometimes the gap is a couple of seconds, sometimes 30 seconds. It used to be consistently two seconds or less.
 

wblock@

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 3,581
Messages: 13,850

#4
Re: Delay after login before password prompt in ssh?

Add an entry for that machine's hostname in /etc/hosts.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,097
Messages: 26,989

#5
Re: Delay after login before password prompt in ssh?

michaelrmgreen said:
Hmm, odd, sometimes the gap is a couple of seconds, sometimes 30 seconds. It used to be consistently two seconds or less.
Check if your primary DNS server works all the time. If resolving through that one fails the system will try the second DNS entry. But this will cause a slight delay as the system has to wait for the first request to time-out. The request to the second server may succeed. If it also fails the delay will even be a little longer. This may account for the variation in timing you are witnessing.

Also check for IPv6. The client might try to use an IPv6 address, fail and fall-back to IPv4. This will also cause an annoying delay but this should only happen during the initial setup of the connection, before you get a login.
 

Habibullah

New Member


Messages: 4

#7
We have the same issue but we change the dnsuse to no even add the machine name in hosts file but didn't work.
please help me in this regards.
 

getopt

Well-Known Member

Thanks: 297
Messages: 498

#8
In file ssh_config set
Code:
VerifyHostKeyDNS no
This prevents SSHFP requests to DNS servers. If the DNS server does not find anything delays occur. This might also be regarded as leaking ssh usage when not configured properly.

In file sshd_config set
Code:
UseDNS no
prevents looking up the IP of a SSH-host, so in most cases there should be used "yes" unless you want to use IP numbers only.
 

Habibullah

New Member


Messages: 4

#9
In file ssh_config set
Code:
VerifyHostKeyDNS no
This prevents SSHFP requests to DNS servers. This is causing the delay if the DNS server does not find anything. This might also be regarded as leaking ssh usage when not configured properly.

In file sshd_config set
Code:
UseDNS no
prevents looking up the IP of a SSH-host, so in most cases there should be used "yes" unless you want to use IP numbers only.
Thank you Mr Getopt
you solve our issue raised 2 months ago .
 
Top