• 1,416 Views

Is It possible to reset root password when the system is on multi-user.target?

Hi there

Well, i have a question, Is It possible to reset root password when the system is on multi-user.target? I was not be able to found a foro o some information related with this and another question that I have, If the grub menu dont show up, is it  posible to reset the root password?

Labels (1)
9 Replies
Chetan_Tiwary_
Moderator
Moderator
  • 1,673 Views

Hello @jennifer1987 !

Thanks for reaching out !

Yes why not ! If you dont have the root privilege or you dont remember the root password - You will need to boot the system into single-user mode. This will give you a shell wherein you can reset the password. 

If GRUB menu is not there then you need to boot with the live ISO ( USB  or DVD ) and then change root password. 

Otherwise, if you have that root privilege: just use passwd command to change the root password in multi user target. 

Refer : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_syst... 

Yeici888
Cadet
Cadet
  • 845 Views

En esta situacion, debes correr una version Live CD/USB del SO que quieres arreglar. Luego de estar en el SO del LiveCD debes montar en /mnt la particion que corresponda a donde esta instalado el sistemas qeu quieras reparar, con lsblk puedes determinar cual es el disco que lo contiene. Por lo general debe ser el primero de la lista de los dispositivos fisicos.

mount /dev/sdaX /mnt

luego usas el chroot para cambiar la raiz del sistema actual por la del disco que recien montaste donde se encuentra el SO que quieres reparar

chroot /mnt

en este punto ya tendrias el SO listo para cambiar la pass

passwd root

sales del chroot desmontas /mnt y reinicias.

Y con eso deberia funcionar. creo
Chetan_Tiwary_
Moderator
Moderator
  • 733 Views

@Yeici888 Por favor lea la respuesta de Fran a su publicación a continuación, ¡gracias!

0 Kudos
Wasim_Raja
Moderator
Moderator
  • 695 Views

huyvl3-fptcloud
Flight Engineer
Flight Engineer
  • 457 Views

Hello @avinash_kumar ,

Perhaps the account (not root) granted will have permission to escalate to root. I guess you used that account and typed "sudo -i" to escalate and thereby change the root password. Is it right? Did you pass the EX200 test?

 
 
 
 
0 Kudos
huyvl3-fptcloud
Flight Engineer
Flight Engineer
  • 395 Views

Hi @Chetan_Tiwary_ , that link has dead. Can you provide other? Please

0 Kudos
JG_Kootstra
Flight Engineer Flight Engineer
Flight Engineer
  • 1,123 Views

If you have a user with sudo Priviledges to be come root:

sudo -i
passwd root

will do the trick
Yeici888
Cadet
Cadet
  • 723 Views

En esta situacion, debes correr una version Live CD/USB del SO que quieres arreglar. Luego de estar en el SO del LiveCD debes montar en /mnt la particion que corresponda a donde esta instalado el sistemas qeu quieras reparar, con lsblk puedes determinar cual es el disco que lo contiene. Por lo general debe ser el primero de la lista de los dispositivos fisicos.

mount /dev/sdaX /mnt

luego usas el chroot para cambiar la raiz del sistema actual por la del disco que recien montaste donde se encuentra el SO que quieres reparar

chroot /mnt

en este punto ya tendrias el SO listo para cambiar la pass

passwd root

sales del chroot desmontas /mnt y reinicias.

Y con eso deberia funcionar. creo
Fran_Garcia
Starfighter Starfighter
Starfighter
  • 531 Views

Hola Yeici,

Es un poco más complicado que eso si estás usando LVM (volúmenes lógicos), ideamente deberías:

- Arrancar el DVD de RHEL en modo rescue, u otro live CD.

- Activar LVM, particiones cifradas con LUKS, etc.

- Montar todas las particiones necesarias para preparar el chroot (incluyendo /sys, /proc, /dev si fueran necesarias)

- Entrar en el chroot

- Crea el fichero /.autorelabel para que selinux no cause problemas tras el reinicio.

- Cambiar la password con `passwd` .

- Salir del chroot y reiniciar el sistema.

 

Un saludo!

 

Fran

Join the discussion
You must log in to join this conversation.