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

michaelrmgreen

Active Member

Reaction score: 20
Messages: 210

What controls the delay between entering the login name and the "Password" prompt appearing in a SSH session?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,683
Messages: 30,622

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.
 
OP
OP
michaelrmgreen

michaelrmgreen

Active Member

Reaction score: 20
Messages: 210

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

Reaction score: 3,644
Messages: 13,850

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

Reaction score: 7,683
Messages: 30,622

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

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

Aspiring Daemon

Reaction score: 404
Messages: 609

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

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