Como Restablecer la Contraseña root
Debe ser configurada una contraseña root mientras instala Fedora Linux, aunque ahora es sigerido para dejar la cuenta de root bloqueada y utilizar sudo. Este artículo describe como proceder si ha utilizado una contraseña root, pero por alguna razón no puede acceder a ella más.
Hay dos métodos comunes para restablecer la contraseña root si se olvida o se pierde.
-
En el Modo Rescate
-
Utilizar un Medio (USB/DVD/CD) de Fedora Live
Cómo restablecer la contraseña root en Modo Rescate
|
Al cambiar las contraseñas como root, no se solicitará la contraseña anterior. |
Mientras arranca el sistema, se exhibirá el menú de GRUB2. Para arrancar el sistema en modo rescate utilice bash siguiendo estos pasos:
-
Selecciona el apunte de arranque que desee para editar con las teclas de flechas.
-
Select the entry you wish to edit by pressing e.
-
Utilice las teclas de flecha para seleccionar la línea comenzando con
linux,linux16, olinuxefi. -
Vaya al final de esa línea e incluya un espacio y lo siguiente
rw init=/bin/bash.If your disk is encrypted, you may need to add
plymouth.enable=0 -
Press Ctrl+X or F10 to boot the entry
-
Ejecute la instrucción:
passwdSe le solicitará que introduzca la contraseña nueva dos veces.
You can also reset a non-root user password using the same command if you specify
passwd <username>. -
Rearrancar la máquina con:
/sbin/reboot -f -
As the boot (GRUB) menu appears (same as the first step), again select the boot entry you want to use, press e, and add the
autorelabel=1option to the end of the command line. This will temporarily set SELinux in permissive mode (instead of the standard enforcing mode), which will allow the relabeling process to proceed, as well as trigger the relabeling process.Then, boot the modified entry with Ctrl+X or F10.
El sistema puede tomar un momento para iniciar mientras que el reetiquetado de SELinux cambia los permisos en el sistema de archivos. Si ve la pantala de inicio de Plymouth puede presionar la tecla ESC en su teclado para ver el progreso de SELinux.
Once it is complete, your system is ready and your password has been successfully changed.
For more information about SELinux states and modes, see Changing SELinux States and Modes.
Como restablecer la contraseña raíz con un Fedora Live Media
|
Para descargar y crear un USB vivo DE Fedora Workstation, sigue las instrucciones en la Documentación Rápida del Medio de Fedora USB Viva. For additional information, specifically about live media using BTRFS, see also Restoring the bootloader using the Live disk |
-
Arranca el medio de la instalación Viva y elije
Try Fedora. -
From the desktop, open a terminal and switch to root using
su(the system will not ask for a password). -
To view your hard drive device nodes, enter
df -Hinto the terminal. For this example we will use/dev/sda1for the/bootpartition and/dev/sda2for the root/partition.If you are using LVM partitions, type:
sudo lvscanand note the/devpath of your root partition. For this example we will use/dev/fedora/root. -
Create a directory for the mount point (use the
-poption to create subdirectories):mkdir -p /mnt/sysimage/boot -
Mount the
/(root) partition (be sure to use the actual device node or LVM path of your root/partition):To mount root on a standard partition scheme enter:
mount /dev/sda2 /mnt/sysimageTo mount root on an LVM partition scheme enter:
mount /dev/fedora/root /mnt/sysimage -
Continue the process by mounting
/boot,proc,/dev, and/runwith:mount /dev/sda1 /mnt/sysimage/boot mount -t proc none /mnt/sysimage/proc mount -o bind /dev /mnt/sysimage/dev mount -o bind /run /mnt/sysimage/run -
chrootto the mounted root partition with:chroot /mnt/sysimage /bin/bash -
Change the root password:
passwd -
Exit out of chroot with:
exitand exit out of the terminal.
-
Reboot your system and boot from the hard drive.
Congratulations, your root password has been successfully changed.
Additional Troubleshooting
-
If you cannot enter rescue mode because you forgot the Firmware/BIOS password here are some options:
-
Refer to your computer’s documentation for instructions on resetting the Firmware/BIOS password in CMOS memory.
-
Temporarily move the system hard disk to another machine, and follow the procedures above to reset the root password.
-
-
If you have set a password for your boot loader, refer to Creating and Using a Live Installation Image.
-
If you want to reset the boot loader password, refer to the instructions on how to Reset the Bootloader Password.
Want to help? Learn how to contribute to Fedora Docs ›