[SOLVED] Install Over Debian 11 and Set Root Password

Apr 11, 2022
132
26
18
I am running into an issue with the install over a fresh Debian 11 install. The Debian image that I am using does not have a root password set. To be able to login for the first time to Proxmox, the root account needs a password. I am using the following line in my Vagrant install script to generate a temporary root password and then display it during the Vagrant build output. After first login, I will change this password to a new one.

The problem: if the install script reboots the instance when it is done, the new root password does not work after reboot. Not on console, not in Proxmox. However, if I don't include the reboot in the script and I manually connect to the console, login once using this new password, then reboot, the password survives the reboot and is usable from console and in Proxmox as expected.

I think this is a core Debian problem, because removing all the Proxmox stuff from the install script and just isolating the password change and the reboot, the same behaviors occur. Even so, if someone has insight as to a fix, that would be awesome.

Here is the line of code used to set the password:

Bash:
# Change Root Password
echo "root:$(cat /dev/urandom | tr -dc '[:alnum:]' | fold -w ${1:-8} | head -n 1)" | tee >( chpasswd )
 

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!