Mingetty
makes it very easy to configure a Linux box for automatic
login. Many distributions use mingetty over the traditional
agetty for logins, including Mandrake and SUSE. If you are
unsure whether your distro uses mingetty simply type grep
mingetty /etc/inittab at a command prompt.
If mingetty is installed, then automatic
login is pretty straight forward. Login as root and edit /etc/inittab.
Modify the entry for the first terminal, tty1. Add --autologin
myusername, where myusername
is the name of the user you would like to automatically login
as (man mingetty for other useful
options). Below you can see the modified part of my Mandrake
/etc/inittab file, before and
after.
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
1:2345:respawn:/sbin/mingetty --autologin
desmatic tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
Note, mingetty autologin is currently misbehaving
on Mandrake 10.1. To solve this problem you need to modify
your PAM setup as follows
su -
sed -i "s/auth.*pam_env.so/#&/" /etc/pam.d/system-auth
If your version of mingetty doesn't yet support
autologin (SUSE 9.1, for example) or your system uses agetty
(LFS, for example), you will need to install mingetty from
source. Note, LFS and Slackware users must first install Linux
PAM as per Beyond
Linux From Scratch.
To install mingetty from source, download
the mingetty
source archive to your home directory and issue the following
commands
cd
tar xvzf mingetty*tar.gz
cd mingetty*/
make
su
make install
exit
Now edit your /etc/inittab
file. Below you can see the modified part of my Linux
from Scratch /etc/inittab
file, before and after.
1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
1:2345:respawn:/sbin/mingetty --autologin
root tty1
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
Once your system is configured for automatic
login, you can automatically launch AdvanceMENU at bootup
by adding the following line to your ~/.bashrc
file
tty | grep tty1 &&
advmenu
|