Skip to content

Instantly share code, notes, and snippets.

@oliverkurth
Last active May 21, 2023 01:50
Show Gist options
  • Save oliverkurth/b4b6ea76815d7e03afbdc9fbbe7ca2ac to your computer and use it in GitHub Desktop.
Save oliverkurth/b4b6ea76815d7e03afbdc9fbbe7ca2ac to your computer and use it in GitHub Desktop.
reset lost password on Photon 4.0

Instructions at https://vmware.github.io/photon/assets/files/html/3.0/photon_troubleshoot/resetting-a-lost-root-password.html work.

In case the web page gets lost:

Restart the Photon OS machine or the virtual machine running Photon OS.

When the Photon OS splash screen appears as it restarts, type the letter e to go to the GNU GRUB edit menu quickly. Because Photon OS reboots so quickly, you won't have much time to type e. Remember that in vSphere and Workstation, you might have to give the console focus by clicking in its window before it will register input from the keyboard.

Second, in the GNU GRUB edit menu, go to the end of the line that starts with linux, add a space, and then add the following code exactly as it appears below:

rw init=/bin/bash

Except the filesystem needs to be remounted for read/write access, or you will see "authentication token lock busy".

mount -o remount,rw /
passwd # change password
umount /
reboot -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment