Password recovery steps is tested to be working under below conditions:
(1) Hypervisor is KVM
(2) virt-manager does not work (unable to install due to some error) meaning that there is no console access to follow normal Flexvnf password recovery steps which is available below:
https://support.versa-networks.com/a/solutions/articles/23000023039
(3) If tacacs authentication does not work for some reason, if enabled.
(4) ssh to the VM via management does not work or it throws login failed error.
Below password recovery steps is applicable if above conditions are true:
https://www.cyberciti.biz/faq/how-to-reset-forgotten-root-password-for-linux-kvm-qcow2-image-vm/
Ensure to remove or comment out tacacs authentication:
$ sudo head -2 /etc/pam.d/login
auth include tacacs
account include tacacs
This step is done after mounting the disk:
# guestfish --rw -a <image-name>
><fs> run
><fs> list-filesystems
><fs> mount /dev/vda1 /
><fs> vi /etc/pam.d/login