photon icon indicating copy to clipboard operation
photon copied to clipboard

Steps for resetting a lost root password not working

Open sidharthsurana opened this issue 9 months ago • 2 comments

Describe the bug

Steps described in https://github.com/vmware/photon/blob/master/docs/photon_troubleshoot/resetting-a-lost-root-password.md and even the release branch are not working

Reproduction steps

Follow the steps in the documentation till the final step of reboot -f However, the command fails. See below screenshot

Image

Image

Expected behavior

System to reboot and root password reset

Additional context

$ cat /etc/os-release
NAME="VMware Photon OS"
VERSION="5.0"
ID=photon
VERSION_ID=5.0
PRETTY_NAME="VMware Photon OS/Linux"
ANSI_COLOR="1;34"
HOME_URL="https://vmware.github.io/photon/"
BUG_REPORT_URL="https://github.com/vmware/photon/issues"

sidharthsurana avatar Feb 27 '25 18:02 sidharthsurana

Hi @sidharthsurana, /proc/ is not mounted seems to be an indication. How did you configure your system? (vhw,efi/secureboot, physical scsi device/vmdk, serial port/network mounted disk image, filesystem/...) Password reset on an ova setup works flawlessly. Tested e.g. on photon-hw15-5.0-dde71ec57.x86_64.ova vanila setup.

Btw. on the docs page the account unlock chapter is old, sbin/faillock --reset --user root works.

dcasota avatar Feb 27 '25 20:02 dcasota

Thanks to @YustasSwamp for helping find the workaround:

In some cases if /proc and /sys are not mounted by default then additional commands are required once booted:

# mount none /proc -t proc
# mount none /sys -t sysfs
### next command is required if you didn't specify rw cmdline parameter
# mount -o rw,remount /  
# passwd
Once password changed
# umount /
# reboot -f

sidharthsurana avatar Mar 06 '25 23:03 sidharthsurana