Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here's my problem, I have a 30-40 second delay after entering a username before I am prompted to enter a password, when I ssh into a vagrant guest VM. Setup is as follows: Windows 7 host, CentOS 6.5 VM that I packaged myself, its pretty much just barebones so I have a clean environment to SSH into. Using Putty for SSH.

The issue appears to be only related to Vagrant. I can launch the VM in VirtualBox and SSH into it using putty, and I am able to connect promptly, like you would expect. I've not made any changes that I can think of to the VM since I used it to create the VM in Vagrant. I should add, once the login process has completed, I am able to use the session with no lag or delay whatsoever.

I'm pretty new to Vagrant, so I assume there's something I did wrong. But I've not had any luck figuring out quite what is is yet. Thanks.

share|improve this question

2 Answers 2

Whenever I have seen ssh delays like the above, it was tied to DNS.

1) Check to see if "UseDNS No" is in your /etc/ssh/sshd_config file 2) if it is not (default is Yes and will be commented), backup your /etc/ssh/sshd_config file 3) Add UseDNS No 4) restart sshd (do not close your current ssh terminal if that is how you logged in) 5) open new putty, see if ssh is better

The reason not to close your old window: if for some reason you mess up syntax or the file, ssh server cannot start properly and you will not ssh in and need to go to the monitor, hard if you are remote. But if you still have your old window open, that won't close and you can copy your backup config back and restart sshd and regain access

Curious if this will work for you and if the different VM types was just a red herring

share|improve this answer

We use PUTTY on windows to SSH into some 300 linux servers across a diverse network environment.

When we have a server that is lagging on the SSH login but then behaves normally once the session is established, we have resolved the issue as follows.

-- Put an entry in the /etc/hosts file of the VM for the VM itself so that the SSH server on the linux guest VM can resolve itself.

Or make sure that your Linux guest VM is entered into your local DNS and the the resolv.conf on your Linux server is correctly configured.

Hope This helps.

share|improve this answer

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.