SUMMARY : Automatic Login after bootup.

From: Lee Fook Heng (
Date: Fri May 13 1994 - 16:18:56 CDT

X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Content-Lines: 107

Hi guys,

Sorry for the late summary. I was busy for a while. Below is a list
of responses that I received. Thanks a lot to those who responded.

Thanks to :

List of emails received

>From Sat May 7 09:16:58 1994
To: fhlee@csam.MY
Subject: Re: Automatic Login after bootup
Content-Type: X-sun-attachment
X-Lines: 112
Content-Length: 3506

I included a script below that you can build on.

We have used this to automatically startup SunNet Manager and
CiscoWorks at boot time. It changes the ownerships of /dev/console
and turns off the getty running on /dev/console (gets rid of the
login: prompt) and starts up OpenWin as a particular user, thus the
OpenWin environment in that user's home dir is started. Upon exiting
OpenWin, the ownerships and /etc/ttytab are reverted to their original

Have fun w/ it!


William J. Maggio
Lan & Computer Integrators, Inc.
242 Old New Brunswick Road Email:
Suite 100 Voice: 908-981-1991

Add a 'su' at the end of your /etc/rc file. We do this to start up openwindows
by having the user 'xnews' logged in automatically.

Put something like this at the end of /etc/rc :

        chmod 666 /dev/console
        su - xnews -c '/usr/openwin/bin/openwin -noauth' > /dev/null 2> /usr/tmp/xnews.err < /dev/console
Jim Volf UUCP:

Emtek Health Care Systems, Inc. Pager: (602) 498-8759
1501 W. Fountainhead Pkwy Phone: (602) 902-2778
Tempe, Arizona 85282 Fax: (602) 902-2616


>From Mon May 9 07:27:48 1994
To: fhlee@csam.MY
Subject: Re: Automatic Login after bootup
Content-Length: 255
X-Lines: 10

Hi ,
        Try add this line to the end of /etc/rc.local files (assuming you are using Solaris 1.x)

login username

        The 'username' must not have password

        It might works (or add "/usr/bin/login username" just in case PATH is not yet defined

Regards Cheah

>From Mon May 9 07:40:18 1994
Subject: Re: Automatic Login after bootup
To: fhlee@csam.MY
Organisation: Telstra Corporation Ltd
Phone: +61-2-339-3953, Fax: +61-2-339-3688
        Travelling To Amsterdam In A Stolen Helicopter -- Nancy Reagan Tells All.
         -- Exclusive Pictures Inside.
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 978
X-Lines: 35

As the very last thing in /etc/rc (assuming SunOS 4.x) put the

    su - hello

For Solaris 2.x you'll have to add the relevant file to /etc/rc2.d

Peter Samuel
Technical Consultant or at present:
Uniq Professional Services
Phone: +61 2 339 3799 Fax: +61 2 339 3688
X-Sun-Data-Type: shell-script
X-Sun-Data-Name: rtes
X-Sun-Content-Lines: 56

# Add to bottom of /etc/rc.local:
# # Now automagically start up SunNet Manager and
# # CiscoWorks environment as the cscoworks user!
# NMSROOT=/usr/nms; export NMSROOT
# if [ -f $NMSROOT/bin/startCW ]; then
# $NMSROOT/bin/startCW &
# fi


# Turn off the the getty on the console (modify /etc/ttytab)
sed -e '/^console/ s/on local/off local/' ${TTYTAB} >${TTYTAB}.bak
cp ${TTYTAB} ${TTYTAB}.old
mv ${TTYTAB}.bak ${TTYTAB}
kill -HUP 1 # Reread new ttytab file

# Change the mode of /dev/console so that $USER can access it
/usr/etc/chown $USER /dev/console
chgrp tty /dev/console
chmod 620 /dev/console

# Run Openwindows as $USER. The user's .openwin-init will start the
# appropriate tools (i.e SunNet manager)
/bin/su - $USER -c /usr/openwin/bin/openwin -display :0

# NOTE: is system was installed without Xview (eg, no Sunview
# installed) need to put following command string in it's own
# executable script:
# /usr/openwin/bin/openwin -nosunview -display :0
# and start this script using the same line as above, like:
# /bin/su -c $USER -c /usr/openwin/bin/openwin_startup_nosunview
# otherwise, the -nosunview option is not parsed on the command
# line and OpenWin will not start automatically!

# Return /dev/console modes back to their original state
/usr/etc/chown root /dev/console
chgrp wheel /dev/console
chmod 622 /dev/console

# Turn the getty on the console back on
sed -e '/^console/ s/off local/on local/' ${TTYTAB} >${TTYTAB}.bak
cp ${TTYTAB} ${TTYTAB}.old
mv ${TTYTAB}.bak ${TTYTAB}
kill -HUP 1 # Reread new ttytab file

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:00 CDT