Auto Login from tty

24-08-21 12:00 simon

If you want to login directly from the tty without a display manager, this is a working method for Arch Linux

As root

systemctl edit getty@tty1

Add this to the top, read the comment about changes. Change simon to your username!

ExecStart=/usr/bin/agetty --autologin simon --noclear %I 38400 linux

This will write to /etc/systemd/system/getty@tty1.service.d/override.conf

Then add

if [ "$(tty)" = "/dev/tty1"  ] ; then

to the end of ~/.bash_profile

Reboot and you will be logged in and XFCE4 started for you.

The only issue so far is logout will drop you to tty1 and if you exit that, you will be logged in and XFCE4 started again.

I was looking into this for an encrypted machine where the password is entered to boot.


Add a comment