Operating System - HP-UX
1752802 Members
5715 Online
108789 Solutions
New Discussion юеВ

Re: Very long login by ssh

 
avizen9
Esteemed Contributor

Re: Very long login by ssh

if possible create a new test account and login with it through ssh.

it will clear the issue is something system related or that particular account related.

Tingli
Esteemed Contributor

Re: Very long login by ssh

Is it possible some file systems (especially the nfs disks) are not mounted?
Steve Post
Trusted Contributor

Re: Very long login by ssh

I had an initial slow ssh connection. I found it was caused by a 500 meg /var/adm/wtmp file. I ran this:

/etc/sbin/init.d/acct stop
/usr/sbin/nulladm /var/adm/wtmp
/etc/sbin/init.d/acct start

Now I ran this during a maintenence cycle so there were no people logged on. Run a man page on nulladm and wtmp.

Why would THIS cause delays to ssh????
Because file ssh_prnd_cmds runs a series of commands for randomness. One of the commands is "last." This command looks at the logins in the wtmp file. If the file is huge, it might take a while to get a response back. That delay in the "last" command WAS my login delay on ssh.

steve
PS: I probably got the solution of this from the hp forums when I was the guy asking about it.
Xou
Advisor

Re: Very long login by ssh

> Check for any command started from the user .profile file(s).

>if possible create a new test account and login with it through ssh.

I create new account with clear .profile but issue long wait are stay on.

>Is it possible some file systems (especially the nfs disks) are not mounted?

Isn't possible because all file systems are local

>I had an initial slow ssh connection. I found it was caused by a 500 meg /var/adm/wtmp file.....

du -k /var/adm/wtmp
32 /var/adm/wtmp

But I execute recommended commands and flush wtmp, issue is stay on.
avizen9
Esteemed Contributor

Re: Very long login by ssh

Have you check for below which bill suggested?

how about reboot this server? possible?


Since the trace indicates that ssh login completed normally with no delays, the problem is with /etc/profile or .bashrc or .bash_profile. If other users do not have delays, then move the .bashrc (and .bash_profile) to another name and try again. If that fixes the problem, then move the bash profiles back and add this to the top of the profile:

set -vx

This will trace each step of the profile on the screen. The delay will be obvious then.


Xou
Advisor

Re: Very long login by ssh

Also no wait when executes a single ssh command(example: ssh user1@SERVER ls) or scp.

Is it problem with pts initialization?
Xou
Advisor

Re: Very long login by ssh

>how about reboot this server? possible?
it isn't possible, system must work 24/7 by SLA.

>set -vx

after long wait same bash prompt standard output displayed:

================
# @(#)B.11.31_LR

# Default user .profile file (/usr/bin/sh initialization).

# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
+ '[' xterm = '' ']'
tset -s -Q
++ tset -s -Q
+ eval export 'TERM;' 'TERM=xterm;'
export TERM; TERM=xterm;
++ export TERM
++ TERM=xterm
stty erase "^H" kill "^U" intr "^C" eof "^D"
+ stty erase '^H' kill '^U' intr '^C' eof '^D'
stty hupcl ixon ixoff
+ stty hupcl ixon ixoff
export TERM=xterm
+ export TERM=xterm
+ TERM=xterm
stty -istrip
+ stty -istrip
tabs
+ tabs

# NOTE: '.' is added to $PATH for compatibility reasons only. This
# default will be changed in a future release. If "." is not
# needed for compatibility it is better to omit this line.
# Please edit .profile according to your site requirements.

# Set up the search paths:
PATH=$PATH:.
+ PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/ssh/bin:/opt/graphics/common/bin:/opt/atok/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/sec_mgmt/bastille/bin:/opt/caliper/bin:/opt/resmon/bin:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/firefox:/opt/gnome/bin:/opt/perf/bin:/opt/ignite/bin:/usr/contrib/kwdb/bin:/opt/mozilla:/opt/prm/bin:/opt/perl_32/bin:/opt/perl_64/bin:/opt/sfm/bin:/opt/swm/bin:/opt/sec_mgmt/spc/bin:/opt/sentinel/bin:/opt/swa/bin:/opt/hpsmh/bin:/opt/thunderbird:/opt/langtools/bin:.

# Set up the shell environment:
set -u
+ set -u
trap "echo 'logout'" 0
+ trap 'echo '\''logout'\''' 0

# Set up the shell variables:
EDITOR=vi
+ EDITOR=vi
export EDITOR
+ export EDITOR

export PATH=/usr/local/bin:$PATH:/pragma/bin
+ export PATH=/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/ssh/bin:/opt/graphics/common/bin:/opt/atok/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/sec_mgmt/bastille/bin:/opt/caliper/bin:/opt/resmon/bin:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/firefox:/opt/gnome/bin:/opt/perf/bin:/opt/ignite/bin:/usr/contrib/kwdb/bin:/opt/mozilla:/opt/prm/bin:/opt/perl_32/bin:/opt/perl_64/bin:/opt/sfm/bin:/opt/swm/bin:/opt/sec_mgmt/spc/bin:/opt/sentinel/bin:/opt/swa/bin:/opt/hpsmh/bin:/opt/thunderbird:/opt/langtools/bin:.:/pragma/bin
+ PATH=/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/ssh/bin:/opt/graphics/common/bin:/opt/atok/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/sec_mgmt/bastille/bin:/opt/caliper/bin:/opt/resmon/bin:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/firefox:/opt/gnome/bin:/opt/perf/bin:/opt/ignite/bin:/usr/contrib/kwdb/bin:/opt/mozilla:/opt/prm/bin:/opt/perl_32/bin:/opt/perl_64/bin:/opt/sfm/bin:/opt/swm/bin:/opt/sec_mgmt/spc/bin:/opt/sentinel/bin:/opt/swa/bin:/opt/hpsmh/bin:/opt/thunderbird:/opt/langtools/bin:.:/pragma/bin
export LANG=ru_RU.cp1251
+ export LANG=ru_RU.cp1251
+ LANG=ru_RU.cp1251
export LC_ALL=ru_RU.cp1251
+ export LC_ALL=ru_RU.cp1251
+ LC_ALL=ru_RU.cp1251

-bash-4.0$ exit
exit
+ exit
logout
echo 'logout'
+ echo logout
logout
Connection to SERVER closed.
Dennis Handly
Acclaimed Contributor

Re: Very long login by ssh

>>set -vx

>after long wait same bash prompt standard output displayed:

You're saying that there is a long wait before the contents of /etc/profile is printed?
If quota checking delays, I think that prints something?

Can you try the same thing with another user that uses the real shell, /usr/bin/sh?
Mel Burslan
Honored Contributor

Re: Very long login by ssh

Could you also provide the contents of your /etc/profile ? Looks like something in there is causing you all this grief.
________________________________
UNIX because I majored in cryptology...
Turgay Cavdar
Honored Contributor

Re: Very long login by ssh

What about the sizes of /var/adm/wtmps and /var/adm/wtmp?