Console autologin for Ubuntu with systemd(15.04 and higher)

agetty version from util-linux starting from Ubuntu 16.04 has option --autologin, but for some reason it doesn’t work for me: creates empty non-responsive terminal. So let’s use mingetty instead.

apt install mingetty

Use systemctl edit getty@tty1 or manually edit /etc/systemd/system/getty@tty1.service.d/override.conf and run systemctl daemon-reload.

ExecStart=-/sbin/mingetty --autologin ubuntu --noclear %I

First ExecStart empty assignment is required, if you want to re-define value in global unit file /lib/systemd/system/*.service.

- prefix makes systemd ignore non-zero exit code and consider it success.

License: This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License Share: share on reddit share on hacker news share on facebook share on twitter share on linkedin share on slashdot