Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up a virtual machine - Debian 6.0.4 - on my Windows 7 host OS. I use VirtualBox as software.

Recently I have started to play with ssh but I have noticed that when I login to the virtual machine through ssh (e.g. Putty) I get a small ( around 5 seconds ) delay between entering my username and password prompt. This delay persists also in access via sftp.

I use openssh-server 1:5.5p1-6+squeeze1.

After logging in everything works like a charm. Anybody has a clue what might be wrong ?

This is my sshd_config

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
Banner /etc/

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#Subsystem sftp /usr/lib/openssh/sftp-server

Subsystem     sftp   internal-sftp
Match Group sftp
    ChrootDirectory /home/%u
    ForceCommand internal-sftp
    AllowTcpForwarding no
    X11Forwarding no
share|improve this question
up vote 1 down vote accepted

You might want to add UseDNS no to the sshd_config, I used this on one of my systems to reduce delay during login.

share|improve this answer
You may still get DNS delays from PAM or TCP wrappers. – David Schwartz Feb 21 '12 at 7:58
UseDNS no helped. Should I use it ? Or should I try finding another solution ? – Patryk Feb 21 '12 at 9:41
Use it if it helps, but you should fix DNS at some point anyway. – David Schwartz Feb 21 '12 at 10:07

This is indicative of the IP address you're logging in from not resolving to a host. who am i will likely show something like patryk pts/0 2012-02-20 15:09 ( instead of patryk pts/0 2012-02-20 15:09 ( It could be as simple as not having a reverse DNS for the host you're sshing in from. However, I'd bet that you don't have anything set in /etc/resolv.conf and because of that, ping will fail.

share|improve this answer
In /etc/resolv.conf I have nameservers inherited from my router and ping (or whatever) works fine. Although I get the results from who am i as you described. What can I do to improve this ? – Patryk Feb 21 '12 at 0:07
You could add an entry in /etc/hosts for your host. That would be easier than delegating an for your host/subnet and firing up DNS somewhere to handle it. – Andrew Beals Feb 21 '12 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .