How do I auto-login as root into the TTY upon boot?
source: http://linux.koolsolutions.com/2009/04/30/autologin-linux-console-mode.
I have gotten it to work, but it is slightly different on Ubuntu.
-
First install
mingetty
:sudo apt-get install mingetty
-
Edit
/etc/init/tty1.conf
:Change:
exec /sbin/getty -8 38400 tty1
To:
exec /sbin/mingetty --autologin root --noclear tty1
Reboot and test.
This worked for me on Ubuntu 12.04, if this works for you and you need more tty's to autologin start changing tty2.conf - tty6.conf and you should be good to go.
In the modern world of systemd, here are the steps I took to get this working:
-
apt install mingetty
-
mkdir -p /etc/systemd/system/[email protected]
-
Now run the following script:
cat > /etc/systemd/system/[email protected]/override.conf <<- "_EOF_" [Service] ExecStart= ExecStart=-/sbin/mingetty --autologin root --noclear tty1 _EOF_
-
systemctl enable [email protected]
The above seems to be the cleanest option for systems that use Systemd that I could find. As an added bonus, if something breaks in the future, you can just run something like the following from a recovery live ISO (after mounting the root partition of course), to restore default behavior:
rm /mnt/root/etc/systemd/system/[email protected]/override.conf