How to speed up your Solaris/OpenSolaris remote login

If you are logging into remote Solaris / OpenSolaris, it could take quite a few seconds to get the login prompt.  If your home directories are exported with NFS while logging (ssh, rsh & telnet) into remote machine this delay can be noticed. The bottleneck here is with the /etc/profile file. 

<<snip>>

 case "$0" in
-sh | -ksh | -ksh93 | -jsh | -bash)

        if [ ! -f .hushlogin ]
        then
                /usr/sbin/quota
                #       Allow the user to break the Message-Of-The-Day only.
                trap "trap '' 2"  2
                /bin/cat -s /etc/motd
                trap "" 2

                /bin/mail -E
                case $? in
                0)
                        echo "You have new mail."
                        ;;
                2)
                        echo "You have mail."
                        ;;
                esac
        fi

esac
<<snip>>

Each time a user logs in /etc/profileshell script is executed.  The script runs quota,mail and displays motd . If your sure that you d'nt need any of this, then go ahead and just touch .hushlogin file in your home directory

$touch ~/.hushlogin

Now login to remote machine and see the difference.


Comments:

Hm, but then it does not display /etc/motd which may contain quite important information.

The following in ~/.profile (or shell rc file) workarounds it:

[ -f ~/.hushlogin ] && [ -r /etc/motd ] && cat /etc/motd

Posted by Vladimir Kotal on July 20, 2008 at 09:47 PM PDT #

Post a Comment:
Comments are closed for this entry.
About

pradhap

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today