# Reset mfeng password

## Purpose

This page describes a procedure to reset the mfeng user password of a Beam 1.x.x server in case:

- you have forgotten it
- you inherit a Beam unit and do not know the mfeng user password

## Pre-requisites

You will need console access to see and interact with the bootloader.:

- Either at a keyboard and monitor locally
- Or via Virtual Machine remote console

## Steps

1. Reboot the machine: As soon as the bootloader comes up with the selection screen, quickly tap the up and down arrow keys to pause the countdown.
   ![os-bootloader](/_machine-assets/b489b6ee79f24038c2c99bde82277cefb5da244d5a95f2b2a8ea8101aca91925.png)
2. Select the kernel you want to boot into. In the screenshot above, the kernel is `AlmaLinux (4.18.0-553.144.1.el8_10.0.x86_64)
   8.10 (Cerulean Leopard)`. Hit `e`: This will take you into a screen where you can edit the grub bootloader script.

![os-bootscript](/_machine-assets/b7d0b8b10b0a3f6194122014d709ad58f02b43d5e003a414a46d90f1470868a7.png)

1. Find the line that refers to the kernel: There will be a series of _boot parameters_ here: these are instructions passed during the loading of the kernel. For RHEL/CentOS/AlmaLinux/RockyLinux 8x or above the line usually starts with `linux`.
   ![os-bootscript-edit](/_machine-assets/0241055013ded69dd916bc7fc182d1bd14e74910b253fa73c3cb722e58526202.png)
2. Add `rd.break` at the end of that line (There are other things you can do here, but for now, this is all you need) **Note: This change is temporary.**.
3. Now hit Ctrl-x to run the edited bootloader script.
4. You’ll boot to a 'rescue' prompt that looks like this: `switch_root:/#`.
   ![os-switchroot](/_machine-assets/de0dd339657fb32d5c2fb79c8149c37215ac68968c4c25bc36013029a19122e4.png)
5. Remount the root partition in read-write mode so that you can run commands. Enter the following: `mount -o remount,rw /sysroot` and then hit ENTER.
6. Now type `chroot /sysroot` and hit enter. This will change you into the sysroot (/) directory, and make that your path for executing commands.
7. Now you can simply change the password for mfeng using the `passwd mfeng`command.
   ![os-switchroot-edit](/_machine-assets/02efad9ba6f756a82883c5b2991ce5b9b212925465627c8fd19c7202733641aa.png)
8. You should get confirmation that the password was changed, such as: `passwd: all authentication tokens updated successfully.`
9. Next, before you reboot, you will need to make sure that SELinux allows the file changes. At the prompt ,enter: `touch /.autorelabel`. This will signal SELinux on the next reboot that the filesystem has changed (the changed password) and allow the change to be loaded. This will cause the whole filesystem to be 'relabeled' which might take a while, depending on the size of the filesystem and the speed of the machine, so be aware of this possibility.
10. Type `exit` to leave the chroot environment and enter `reboot`.

The system will reboot and SELinux should attempt to relabel files. Once relabelling is complete, the system should reboot again and present the regular terminal prompt.

Congratulations, you've reset the mfeng user password!
