Results 1 to 10 of 10

Thread: How to recover Root Password in Leap 15.3

  1. #1

    Default 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.

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    16,016
    Blog Entries
    3

    Default Re: How to recover Root Password in Leap 15.3

    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:
    Code:
    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
    Code:
    exit
    reboot
    openSUSE Leap 15.4; KDE Plasma 5.24.4;
    testing Tumbleweed.

  3. #3

    Default Re: How to recover Root Password in Leap 15.3

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

    Thanks a lot!

    Vadim.

  4. #4
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    16,016
    Blog Entries
    3

    Default Re: How to recover Root Password in Leap 15.3

    I'm glad to have helped. And thanks for reporting back.
    openSUSE Leap 15.4; KDE Plasma 5.24.4;
    testing Tumbleweed.

  5. #5

    Default Re: How to recover Root Password in Leap 15.3

    Quote Originally Posted by nrickert View Post
    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"
    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?

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    16,016
    Blog Entries
    3

    Default Re: How to recover Root Password in Leap 15.3

    Quote Originally Posted by VeN419 View Post
    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:
    Code:
    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.
    openSUSE Leap 15.4; KDE Plasma 5.24.4;
    testing Tumbleweed.

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,951

    Default Re: How to recover Root Password in Leap 15.3

    Quote Originally Posted by VeN419 View Post
    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?
    Like said above, you should report more precise and exact. E.g.
    Code:
    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.
    Henk van Velden

  8. #8

    Default Re: How to recover Root Password in Leap 15.3

    Quote Originally Posted by nrickert View Post
    It would help if you told us exactly what you did.

    After that "chroot" you can use the command:
    Code:
    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.
    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

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,951

    Default Re: How to recover Root Password in Leap 15.3

    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.
    Henk van Velden

  10. #10

    Default Re: How to recover Root Password in Leap 15.3

    Quote Originally Posted by hcvv View Post
    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!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •