The following follows the general method for resetting a root password on a Linux machine, if you have access to the console see e.g.:
for similar suggestions.
Keep in mind that editing the kernel command-line might need a different key-entry based on your boot-loader (e
works for both grub
and systemd-boot
though).
The method works for Proxmox VE until version 8.1 and should work for many other Linux based Operating systems as well:
grub
or systemd-boot
, select your preferred kernel but do not press enter.grub
: scroll down to the kernel
line you will boot from, it starts with linux /vmlinuz-...
systemd-boot
the kernel commandline is directly editablequiet
in the line and append init=/bin/bash
grub
press Ctrl X
to boot, for systemd-boot
simply press EnterIn the resulting shell:
# Remount / as Read/Write mount -o remount,rw /
# Change the root account password with passwd
# Change any other account password with passwd username
# type new password, confirm and hit enter and then reboot.
/
filesystem of your PVE installation (mostly relevant for installs on ZFS) (e.g. a Proxmox install ISO, in debug-mode (second debug-shell))/
filesystem in read-write mode at a free directory (e.g./mnt
will be used in this example).
zpool import -f -R /mnt rpool
for ZFS.passwd -R /mnt
to set a new password for the root
account./
-filesystem and reboot.pct enter <VMID> passwd # enter new password in silent prompt exit
vzctl enter <VEID>
to enter the container.