[SOLVED] SSH - Slow Login

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
maksaraswat
Posts: 44
Joined: 2011/10/14 19:00:52
Location: New York
Contact:

[SOLVED] SSH - Slow Login

Post by maksaraswat » 2012/03/26 17:38:22

Hi,

I am having random ssh issues. Sometimes when I try to login it gives me following

user@HOSTNAME:~$ ssh root@SERVER
root@SERVER's password: <-- Waits here for about a minute or so
Write failed: Broken pipe


And sometimes it takes a lot of time for login prompt to come up and once password is entered it takes lot of time to login. I Googled and found that slow login prompt could be because of DNS and I changed the DNS and login prompts are almost instantaneous. However it still takes time after entering the password.

I also did ssh -vvv root@SERVER and still is very slow

root@SERVER's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session. <-- very slow from this point onwards and takes about 30-45secs to complete the login
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Mon Mar 26 13:24:58 2012 from X.X.X.X
[root@SERVER ~]#

The ssh server is CentOS 5.8 and client is Ubuntu 10.04.


Thanks in advance!

Mayank

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SSH - Slow Login

Post by TrevorH » 2012/03/26 21:23:30

I doubt if it's necessary but did you restart the ssh daemon? Looking at `man resolv.conf` it says

[quote]
The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process.
[/quote]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] SSH - Slow Login

Post by pschaff » 2012/03/26 21:28:23

Did you fix the DNS for both server and client? Can each resolve the other's hostname?

maksaraswat
Posts: 44
Joined: 2011/10/14 19:00:52
Location: New York
Contact:

Re: SSH - Slow Login

Post by maksaraswat » 2012/03/27 15:24:05

Gents,

Thanks for the responses! SSH seems to be working fine. There was a PTR error as well which I saw and fixed it by deleting the PTR record. There was another host with same DNS entry as mine. I had few OpenOffice and Java update on the server and just for sanity I restarted my server.

@Phil - I only did fixed the DNS on the ssh server.

@TrevorH - I didn't had to restart the ssh daemon. The server restart took care of it.


--Mayank

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: [SOLVED] SSH - Slow Login

Post by pschaff » 2012/03/27 15:26:49

You are welcome. Thanks for reporting back. Marking this thread [SOLVED] for posterity.

Post Reply