[SOLVED] Auto-Login for Root on Local TTY or Password-Free Access

shalak

Member
May 9, 2021
44
0
11
38
Hello!

I'm looking for a way to enable root auto-login or bypass the password prompt, but only for local TTY (physical monitor and keyboard). It's important that full PAM authentication remains for web GUI and remote access.

Anybody knows the elegant way to achieve this?
 
as Proxmox VE is a standard Linux Debian, you can search for Linux, and find like this
https://superuser.com/a/970013

Yep, the systemd drop-in unit (followed by systemctl daemon-reload) did the trick:

Code:
# cat /etc/systemd/system/getty@.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noclear --autologin root %I $TERM

The original unit has ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM that replaces 'login' arguments with an option to preserve environment - unfortunately, that doesn't work with autologin, i.e. this is not correct:

Code:
ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --autologin root %I $TERM

So I guess, we're loosing the environment preservation when we enable autologin. I wonder why was it set in a first place?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!