Login takes 44secs to 50secs

Hi,

Anyone can help me, I have 10 servers all was Solaris 10 installed. The 9 servers was so fast ounce you login.

But only 1 server will take 44secs to 55secs to login. I check all the hardware side it was ok. I'm using ssh, putty, ftp and telnet to login.

Can you please me for any work around to find what happenings on the said server.

Thanks in Advance,
FSP

Check DNS resolution / pam.conf / login authentication. what you are seeing is the server timing out trying to either authenticate the user id, or trying to mount the users home directory, or something user related.

If you can logging in as root, then I reckon its DNS/ nsswitch.conf / resolv.conf or something like that which is pointing to the wrong server. Even check /etc/defaultrouter.

SBK

Hi SBK,

Here the output of the said command, what's wrong with these some of my servers look like these setting but more faster to login.

login as: myuser1   ### here will take 44secs to 55secs
Using keyboard-interactive authentication.
Password:

Last login: Wed Sep 28 15:49:04 2011 from 192.168.51.37
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.

bash-3.00$

#####################################

bash-3.00$ less /etc/nsswitch.conf
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)nsswitch.files     1.14    06/05/03 SMI"

#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

passwd:     files
group:      files
hosts:      files dns
ipnodes:    files
networks:   files
protocols:  files
rpc:        files
ethers:     files
netmasks:   files
bootparams: files
publickey:  files
# At present there isn't a 'files' backend for netgroup;  the system will
#   figure it out pretty quickly, and won't use netgroups at all.
netgroup:   files
automount:  files
aliases:    files
services:   files
printers:       user files

auth_attr:  files
prof_attr:  files
project:    files

tnrhtp:     files
tnrhdb:     files
bash-3.00$

#####################################

bash-3.00$ less /etc/resolv.conf
domain  macau.com
nameserver 202.111.6.38
nameserver 202.111.6.48

#####################################

bash-3.00$ less /etc/defaultrouter
192.168.2.333

Regards,
FSP

Do you mean it is very slow to bring up the login prompt, or is it slow when doing the username authentication?

Hi Tommy,

"slow when doing the username authentication"

When I hit the enter key on Login as : myuser1

Regards,
Ferdie

when you log in, can you run some diagnostic commands and compare to your other boxes if its busy or if there are any processes running on it.

do a "top" command and compare CPU idle and free memory and used memory

maybe run a ps -ef and see all your running processes.

this isn't a problem resolving the hostname its a problem with the server itself, usually this slowness is caused by the machine taking a long time to respond because its busy.

If its not busy, try creating a new user and logging in with that does it take a long time also? it could be your .profile and .bashrc in your home directory. or could be /etc/profile or /etc/bashrc trying to execute a lot of commands which take a while.

Do all these files match between your servers or is there any differences in command execution?

do you log in as root ?? or just a normal user ??

If you log in as root, is the login process slow, i.e. the time it takes to come back and ask you for your password, or after the password, to then see you prompt ? Then your system is running slow, so need to do the top / vmstat / ps stuff to find out why.

If it isnt slow when logging via root, and only when you log in via a normal user then its something userid / home dir issue. Do your users auto mount thier home directory ? Do you have some 3rd party authentication s/w like VAS ? This is why I asked you to check your local DNS / pam.conf settings.

Does this normal user have some commands it runs via the .profile ?? i.e. does it fire off something the moment you log in ?? So, check the .profile / .cshrc or whatever shell you are using.

So, do two tests, login as root, see what happens. Log in as a normal user, and see what happens.

SBK

Run this from your home directory after you log in:

touch .hushlogin

Try logging in again.

The default login process is to run a quota check for space usage against all files systems. If the server you're logging into has a lot of file systems - especially NFS-mounted file systems - that can take a while.

Usually creating a ".hushlogin" file in your home directory will disable the quota checks.

If that doesn't work, you really need root access to definitively locate the issue.

Find the "parent" sshd daemon, then as root run truss against it:

 truss -f -a -vall -l -d -o /some/SECURE/output/file -p SSHD_PID

Make SURE the output file you select is secure - it will have your password embedded in it if you use password authentication. And that of everyone else who logs in while the truss process is running.

While that's running, log in, log out, kill the truss process, and look into the output. You'll see all the system calls made by the original sshd daemon, along with all the child processes fork()'d off. Somewhere in there, you'll see some long delays. Whatever is taking long to do, that's where your delay is.

bash-3.00$ less /etc/defaultrouter 192.168.2.333

There's yer problem.

i had the similar issue on one of my server. Was related to a DNS misconfiguration.
take very long to connect (estabilish a connection to the host) and also to login!

my suggestion is to recheck your dns configuration.

is there a sapce or tab (are not allowed) after "domain macau.com" in your resolv.conf file?

or what you can try is to save the hostname and ip of your remote server in your /etc/hosts file. If it's faster than you have a problem in you dns config!!

Hi sbk1972, tommyk, echenle, beta17,

I combined all your approach it works well, I�m really impressed. Salute you guys. Many thanks.

Regards,
FSP

and what exactly solved your issue? :slight_smile: