Autologin on Ubuntu and go straight to terminal


command line

Configure an Ubuntu machine to autologin and go straight into the terminal on boot.

Information

Works on Ubuntu 20.04 but untested in 22.04 or other distros.

sudo systemctl edit [email protected]

This should open the override.conf file in your default text editor, creating one if it does not already exist. (If the above does not work, try sudo systemctl edit getty@tty1 instead.) Most likely the file will not exist so it will be newly created and empty, copy and paste this string of text into it (where [user] is an existing user with sudo privileges):

ExecStart=-/sbin/agetty --autologin [user] --noclear %I $TERM

Look for the line ExecStart= and replace whatever is in there with the above. Save the file and next reboot skip the login and go straight to the terminal.

My Use Case

My reason for wanting to do this was to have my PiHole device automatically execute the PADD script automatically on reboot and display the stats. Using the above steps I was able to get the PiHole to boot up, skip login and automatically execute the script to display the stats.

Reference