tl;dr Can I override the auto-login feature sometimes, to log in as root?

My Pi is running Raspbian Jessie and acting as a kiosk in a public location. For this reason I have renamed the pi user and removed sudo privileges.

To get auto-login working I used the raspi-config command, boot options, CLI auto-login, to generate an autologin service file in /etc/systemd/system/autologin@.service and changed the username in that file. This works great.

Normally I will use ssh to remotely administer it, but in case of network failure I'd like the ability to log in locally.

However even if I exit from the terminal it logs me right back in. Is there a way to override this and log in as root?


I discovered I can use the keyboard combination CTRL+Alt+Fn (F1-F7) to switch between different virtual terminals. Only the first terminal (F1) will automatically login, so I can use different credentials on the others.

However I don't think this is documented behaviour. I believe that service file should run on all virtual terminals and not just the first one, so if behaviour changes in the future then this guide for Arch might be relevant:

Create a new file for terminal 1 '/lib/systemd/system/getty@tty1.service' and copy into it the config you defined above.

In /lib/systemd/system/getty@.service use the following:

ExecStart=-/sbin/agetty --noclear %I $TERM

Console 1 will autologin [..] all other consoles will prompt for credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.