Operating System - Linux
1752796 Members
5521 Online
108789 Solutions
New Discussion юеВ

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

it is very slow to get command prompt after entering the password when logging thru putty (ssh)

Hi All,

In of my Suse linux server, it is very slow to get command prompt after entering the password when logging thru putty (ssh).

How to solve this?
6 REPLIES 6
Steven Schweda
Honored Contributor

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

Is this the same (reverse-) DNS problem as
in:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1358233

?

A Forum search for keywords like
ssh slow
might find some of the dozens of similar, old
threads.
senthil_kumar_1
Super Advisor

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

But i am able to resolve the name and ip thru DNS running in that particular Linux server.
Ivan Ferreira
Honored Contributor

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

To identify if the problem is reverse dns lookups, you could configure the following option in sshd_config and reload the service:

UseDNS no

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven Schweda
Honored Contributor
Solution

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

> But i am able to resolve the name and ip
> thru DNS running in that particular Linux
> server.

Which "name and ip" can you resolve where?
Evidence?
Matti_Kurkela
Honored Contributor

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

Can you identify where the slowness happens? Does it happen before /etc/profile starts, or somewhere within /etc/profile or your personal login script?
Add some commands like:

echo "in the beginning of /etc/profile"

to various locations in the login scripts, then try to locate the point where the system spends a lot of time.

One common reason for slow logins is a large wtmp file (/var/log/wtmp in most Linuxes). This usually affects all logins, not only SSH logins. In this case, the slowness usually happens before /etc/profile starts executing.

The wtmp file records all login/logout events. The system must search through it to find & display the last login times. The bigger the file is, the more time the login procedure takes.

RedHat systems have a cron job that periodically truncates the wtmp file (using logrotate to archive a few old versions). This prevents it from ever getting too big. You should check if SuSE has ready-made scripts or cron jobs to manage the wtmp file, and consider enabling them. If there is nothing, write your own.

The simplest script for truncating the wtmp file would be:

#!/bin/sh

# backup the old wtmp file
cp /var/log/wtmp /var/log/wtmp.old
# truncate the wtmp file
> /var/log/wtmp

MK
MK
Stephen P. Schaefer
Frequent Advisor

Re: it is very slow to get command prompt after entering the password when logging thru putty (ssh)

In addition to the other suggestions, check whether ssh is having trouble running xauth - and don't tunnel X if you don't need to.