3

When I log in using SSH or after pressing Ctrl+Alt+F1, it takes several seconds after I enter my password to finally show the following:

Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-28-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

0 packages can be updated.
0 updates are security updates.

Last login: Thu Jan  1 00:00:00 1970
Unable to connect to X server
Unable to connect to X server

user@host:~$ 

What is it doing that causes it to take several seconds to get to a shell prompt? How can I speed it up?

2
  • This usually happens because of resolv.conf issues. What is the domain name of your server? Can it reach that? It is trying to resolv root controllers
    – dedunu
    Mar 24, 2018 at 3:50
  • UseDNS=no is the solution for this problem. Change sshd_config.
    – dedunu
    Mar 24, 2018 at 3:52

1 Answer 1

0

"What is it doing that causes it to take several seconds to get to a shell prompt?"

It's using RSA to establish a secure, authenticated connection, and then does a Diffie-Hellman ratchet to establish forward security by generating a one-time key. So there's a good deal of security overhead with SSH.

3
  • 1
    That wouldn't affect the loading of a local TTY, though, would it? OP said when they press <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F1</kbd> it takes several seconds to load the command prompt after they enter their password. I'm thinking it has something to do with the Unable to connect to X server errors. Jul 10, 2016 at 21:26
  • Maybe, but I experience a similar delay when I ssh into my server, and I get no such errors. Jul 10, 2016 at 21:36
  • I don't think this is a bad answer, since it does apply to a lot of people who would ask about a delay, but SSH only takes a short while longer than the text console (Ctrl+Alt+F1) to log in and then both take several seconds to get to the shell prompt for me.
    – Olathe
    Jul 10, 2016 at 23:07

You must log in to answer this question.

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