Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've just installed 12.04.2 server amd64 in VMWare Player and noticed that there is a 3-5 seconds delay after I put the password and before the shell appears. The same happens when I try to connect using some SFTP software.

In the logs it looks like:

Jun 26 22:40:01 ubuntu-1204-2-server-amd64 sshd[1525]: Accepted publickey for zerkms from 192.168.19.1 port 56018 ssh2
Jun 26 22:40:01 ubuntu-1204-2-server-amd64 sshd[1525]: pam_unix(sshd:session): session opened for user zerkms by (uid=0)
Jun 26 22:40:04 ubuntu-1204-2-server-amd64 sshd[1662]: subsystem request for sftp by user zerkms
Jun 26 22:40:04 ubuntu-1204-2-server-amd64 sshd[1525]: pam_unix(sshd:session): session closed for user zerkms

I've already added UseDNS no to /etc/ssh/sshd_config (and I didn't forget to restart ssh after that. I even reboot the whole server ;-)

Anything else I missed? Any ideas?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

start another sshd in debug mode (no need to stop the regular daemon) on a high port number for instance 2222 and connect to that server, you will see at what point the server is stopping. You can play with the debug level by adding more d's.

#/usr/sbin/sshd -dd -p 2222  

edit :

Maybe sshd is not the problem but the login process. Try to bypass all the profile scripting by directly starting a remote shell, see if it connects faster.

# ssh -t user@servername /bin/bash

(option -t will gets you a tty so you bash will show a prompt and will have command line editing)

Session script should to be the cause as your logs shows the session is opened after

share|improve this answer
    
Well, today I started the same machine and now the problem gone though I haven't done anything explicitly. Thanks for your time, if the issue comes back I'll definitely try running sshd with extra debugging level logs –  zerkms Jun 28 '13 at 8:09

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.