Why does ssh take so long




















The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Why does it take tens of seconds to get a shell prompt? Ask Question. Asked 6 years, 1 month ago. Active 17 days ago. Viewed 8k times. Improve this question. Is there a lot of lines in your.

Look at your. You probably have a command s that are timing out. Alternatively to Moby Disk's suggestion, is it still equally slow if you start the shell itself from within the shell? If it's slow when re connecting but fast when starting a second shell from within an existing, connected session, that will tell you that it's not the shell itself that is causing the slowness; if it is equally slow in the two situations, then something the shell does on startup is taking a lot of time.

Either way you learn some about which aspect of "from zero to shell prompt" is slow. Other times, it's DNS reverse lookups. Show 4 more comments. Active Oldest Votes. Chances are your problem boils down to one of a few things. The select syscall above waiting for data from file descriptors took 3. The clone syscall above essentially forks a new child process.

And now we are finally getting to the interesting part, given that we are troubleshooting SSH login delay. All we need to do now is walk backward in the trace to find what that file descriptor 4 actually pointed to in that process at the time.

So I could ping the host 1. Many of you probably knew from the start that a usual suspect causing such problems is a reverse DNS lookup where the daemon wants to find the fully qualified domain name of whatever client IP address is connected to it. Indeed, the request hung for 10 seconds and then timed out. So all I need to do is to configure my server to use a functioning nameserver. In my case I changed the nameserver value to So, full tracing with some postprocessing may be needed in order to find the longest-taking system calls out of a big tracefile.

Show 9 more comments. Eric Carvalho I had password authentication and the delay was for that password entering prompt to appear.. I waited for that to appear then did ctrl-c so the 'time' didn't include me entering the password. PandurangPatil Bad configuration option: usedns — Yuseferi. That will help understand why it's bad config — Pandurang Patil. Show 1 more comment. It is something that comes wrong from Ubuntu's installation. Ubuntu's configuration isn't wrong.

In some cases home networks with no central DNS servers , it's the right thing. In others networks where mDNS requests time out , it's bad. Neuquino It should be there. It's there for a reason you don't understand, apparently. Fiddling with your nsswitch. This seems to me the only solution that works — linello. In my case, the issue can be solved by restarting systemd-logind : systemctl restart systemd-logind This is mentioned on Serverfault. Candid Dauth Candid Dauth 4 4 silver badges 7 7 bronze badges.

ErikWeitenberg ErikWeitenberg 11 1 1 bronze badge. I commented out following line on the destination server and it resolved the issue in my case Code:. Thread Tools. BB code is On. Smilies are On. All times are GMT The time now is AM. Twitter: linuxquestions. Open Source Consulting Domain Registration. Visit Jeremy's Blog. Search Blogs. Mark Forums Read. SSH : Takes a long time to login to a remote server.

User Name. Remember Me? Linux - Networking This forum is for any issue related to networks or networking. Routing, network cards, OSI, etc.



0コメント

  • 1000 / 1000