I get a case that I have to log in to an instance on Openstack without going through the instance IP (because it can't be reached) so I have to try to enter from the console for troubleshooting in the OS. Here's one of my ways to log in using the root
user on Ubuntu Server 20.04 LTS running on top of Openstack.
- Goes to
Horizon -> Project -> Instance -> Click on your Instance -> Console
. - If you doesn't have access to Horizon, you can use
virsh console
but will not shows in here.
- Click on
SendCtrlAltDel
- while rebooting from the beginning immediately press
esc
repeatedly until it enters theboot order
menu - when the boot order window opens, please press
e
- Find
linux /boot/vmlinuz-xxxxxxxx
- Replace
ro quiet
withrw init=/bin/bash
- Remove
console=ttyS0
- Press CTRL + X
- when you enter
root@(none):/#
dopasswd
root@(none):/#
root@(none):/# passwd
- Then reboot with
exec /sbin/init
root@(none):/# exec /sbin/init
- https://www.tecmint.com/reset-forgotten-root-password-in-ubuntu/
- https://platform9.com/kb/openstack/how-to-boot-into-recovery-mode-on-an-ubuntu-cloud-image
- https://blog.ajiarya.id/posts/openstack/cara-reset-password-root-instance-ubuntu/
- https://jpenatech.wordpress.com/2017/04/20/successfully-resetting-the-root-password-of-a-centos-7-vm-in-openstack/
- https://blog.ajiarya.id/posts/openstack/cara-reset-password-root-instance-centos/
- https://jpenatech.wordpress.com/2017/04/20/successfully-resetting-the-root-password-of-a-centos-7-vm-in-openstack/
- https://linuxconfig.org/redhat-8-recover-root-password
- https://serverfault.com/questions/432531/what-does-the-autorelabel-file-do-in-linux