Reset/Unlock Photon OS root account

From time to time your root account can get locked from either entering the incorrect password or using some automation that uses the wrong password. Here are some quick steps.

Reboot the Photon Appliance

At the Photon OS logo screen press e to edit the grub menu

At the grub menu append the following to the end of the boot loader line to boot into single user mode

rw init=/bin/bash

Press F10 or CTRL+X to continue the boot process

At the prompt type the following to mount the root partition

mount -o remount,rw /

To reset the root password type passwd and enter the new password

If the root account was locked due to x number of failed logon attempts type to following to unlock it

/sbin/pam_tally2 -r -u root

Unmount the partition again

umount /

And reboot

reboot -f

Hopefully you should now be able to log in with your root account!

Verify NTP Configuration on a VMware Photon Appliance

Quick post with the commands required to verify NTP configuration on a VMware Photon OS Appliance

ssh to the appliance as root

To check if the NTP service is up and running you can run this command

systemctl status systemd-timesyncd

If its stopped run this command

systemctl start systemd-timesyncd

To configure NTP servers run the following

vi /etc/systemd/timesyncd.conf

Add timeservers under [Time]