How to recover Root Password in Leap 15.3

Hi all.

How do I recover Root Password in Leap 15.3? None of the known methods are working for me.
I have upgraded from Leap 15.2 with a help of network image.

Thanks and sorry, if this question you hear for too many times.

Vadim.

You usually cannot recover it. But you can change it to something that you know.

Boot your network image to the rescue system. Mount the root file system at “/mnt”

And then:


mount --bind /dev  /mnt/dev
mount --bind /proc  /mnt/proc
mount --bind /sys  /mnt/sys
chroot /mnt
mount -a
passwd root

That should prompt you (twice) for the new root password


exit
reboot

That worked for me!! It was a pleasant surprise.

Thanks a lot!

Vadim.

I’m glad to have helped. And thanks for reporting back.

Hello.Can you please explain how exactly to do this? I do:
mnt /dev/sda5 /mnt

And further down the list
But it doesn’t ask for a password twice. What am I doing wrong?

It would help if you told us exactly what you did.

After that “chroot” you can use the command:

script

That will create a transcript of your session, which you can then use to post what you did.

The transcript file is called “typescript” and is just plain text. If you do that immediately after the “chroot” command, then it will be in “/mnt” which is the root directory of your mounted system.

Like said above, you should report more precise and exact. E.g.

mnt /dev/sda5 /mnt

can not be correct, because there is no command “mnt” (you probably want to use “mount”). And are you sure that /dev/sda5 contains the root file system of your system?

Oh, and you can leave out all different fonts and font sizes. That does not really make it better readable.

tty1:rescue:# ls /mnt total 0 tty1:rescue:# mount /dev/sda5 /mnt
tty1:rescue:# ls /mnt .cache .snapshot bin boot dev etc home lib lib64 mnt opt proc root run sbin selinux srv sys testdisk.log tmp usr var tty1:rescue:# mount --bind /dev /mnt/dev
tty1:rescue:# mount --bind /proc /mnt/proc tty1:rescue:# mount --bind /sys /mnt/sys
tty1:rescue:# chroot /mnt rescue:/ # script script: openpty failed: No such file or directory Terminated rescue:/ # mount -a rescue:/ # passwd root New password: Retype new password: passwd: password updated successfully rescue:/ # exit tty1:rescue:# reboot

Now you have set the root password in the chrooted system (your “normal” system). To me that looks OK. Is there still a problem?

===========

BTW:
There is an important, but not easy to find feature on the forums.

Please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

An example is here: Using CODE tags Around your paste.

Ok, sorry. I’'ll learn.
Password in my OS not change after this actions.

UPD: sorry, it worked! Thank you very much!