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:
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 )