Console autologin for Ubuntu with systemd(15.04 and higher)

agetty version from util-linux in Ubuntu Xenial 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 deamon-reload.

[Service]
ExecStart=
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: Creative Commons Attribution-ShareAlike License Share: share on reddit share on hacker news share on facebook share on twitter share on linkedin share on slashdot