How to set up auto-login in Fedora Server?

Fedora Server use systemctl/systemd just as most distros today, and I learn that for it to set auto-login I should use

systemctl edit getty@tty1

And then input

[Service]
ExecStart=
ExecStart=-/usr/sbin/agetty --autologin your_user_name --noclear %I $TERM

I tried, but failed. System told me changes were canceled and files are cleaned. I have disabled SELinux, it doesn’t work.

So, help

The man page for systemd.service states:

… Unless Type= is oneshot, exactly one command must be given. …

But the Type for the getty service appears to be ‘idle’:

$ grep '^Type=' /usr/lib/systemd/system/getty@.service
Type=idle

So I would guess that at least part of the problem is the extra ‘ExecStart=’ line.

1 Like