6

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.

2 Answers 2

5

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

1
  • In 2023 using Gentoo, there's an /etc/ssh/sshd_config/ directory with *.conf files. Simply drop a UseDNS No into something like 999-no-dns.conf file and restart. May have fixed my issue. Commented Sep 21, 2023 at 5:54
1

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.

You must log in to answer this question.

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