Automatic login to virtual console

From Gentoo Wiki
Jump to: navigation, search

You can set automatic login by editing /etc/inittab. You must add -a username to login the specified user automatically.

FILE /etc/inittab
c1:12345:respawn:/sbin/agetty -a username --noclear 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux

You can combine this with Start_X_on_login to automatically startx on startup.

Alternatively, for systemd you can use a drop-in like:

FILE /etc/systemd/system/getty@tty1.service.d/override.conf
ExecStart=-/sbin/agetty --autologin username --noclear %I 38400 linux