Kunnskapsbase

I forgot my root password Skriv ut

  • root, password, recovery, console
  • 0

Overview

If you have lost the root password for your Pod, you can regain access through the VNC console in the ALYPOD Console. SSH cannot help here — you need local console access.

Before you begin

  • Access to the ALYPOD Console.
  • Confirmation that you have console access to the Pod (the VNC console works even when SSH does not).
  • A snapshot is recommended before you begin, in case you need to roll back.

Steps

  1. Open the VNC console for your Pod in the ALYPOD Console and log in with any account that still has sudo access.
  2. If you can sudo, simply reset the password:

bash sudo passwd root

  1. If you cannot log in at all, reboot the Pod and interrupt the bootloader (usually Esc or Shift at the GRUB menu) to edit the boot entry.
  2. At the end of the linux line, add rd.break (RHEL-family) or init=/bin/bash (Debian/Ubuntu) and boot.
  3. In the recovery shell, remount the filesystem writable and reset the password:

```bash

Debian/Ubuntu

mount -o remount,rw / passwd root

then reboot

exec /sbin/reboot ```

```bash

RHEL-family with rd.break

mount -o remount,rw /sysroot chroot /sysroot passwd root touch /.autorelabel exit reboot ```

  1. Reboot normally and log in with the new password.
  2. Immediately afterwards, consider restoring key-only SSH and rotating any credentials that may have been exposed during recovery.

Troubleshooting

  • Problem: The filesystem is read-only and passwd fails. Solution: Remount it read-write first (mount -o remount,rw / or mount -o remount,rw /sysroot).
  • Problem: SELinux prevents login after a rd.break reset. Solution: Create /.autorelabel as shown, which relabels files on the next boot.
  • Problem: Your account is also locked out. Solution: Use the same recovery shell to reset the account password with passwd <user>.

Related articles

  • [The server will not boot]
  • [Hardening SSH]
  • [I cannot connect to my Pod via SSH]

Var dette svaret til hjelp?

« Tilbake