Fedora 41 Change root password

Fedora 41 Change root password

You can change your root password on several ways, if you forgot it.

The short way

or

Or the long way

Restart the system: Restart the system or switch it on.

GRUB menu: Press a key (e or c) during the startup process to edit the GRUB startup menu (the boot loader).

Edit boot parameters: Find the line that starts with linux or linuxefi. Add a new parameter at the end of this line. In the past, this was often single or init=/bin/bash. Today, rd.break or rw init=/bin/bash is often used to put the system in a state where you can obtain a root shell without a password.

Remount the file system: In some cases, especially with the rd.break parameter, the file system is mounted as read-only. Before you can change the password, you must remount it in read-write mode:

Change password: Now you can run the passwd command to change the root password: passwd.

Restore SELinux context: If you are using SELinux (which is standard in Fedora), you must create a file called .autorelabel. This ensures that SELinux correctly adjusts the file permissions after the reboot so that the system does not fail.

Restart the system: Finally, restart the system, usually with reboot -f or exit followed by exit.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

error: Content is protected !!