Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Last active March 14, 2023 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilangvperdana/77ad1d7a405aeeb472b2eacb8eebf2ef to your computer and use it in GitHub Desktop.
Save gilangvperdana/77ad1d7a405aeeb472b2eacb8eebf2ef to your computer and use it in GitHub Desktop.
Reset Ubuntu Root Password from Openstack Console (VNC)

General

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 VNC

  • 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.

Execution

  • Click on SendCtrlAltDel
  • while rebooting from the beginning immediately press esc repeatedly until it enters the boot order menu
  • when the boot order window opens, please press e
  • Find linux /boot/vmlinuz-xxxxxxxx
  • Replace ro quiet with rw init=/bin/bash
  • Remove console=ttyS0
  • Press CTRL + X

Change Password

  • when you enter root@(none):/# do passwd
    • root@(none):/#
    • root@(none):/# passwd
  • Then reboot with exec /sbin/init
    • root@(none):/# exec /sbin/init

Reference

For CentOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment