Results 1 to 4 of 4

Thread: Lost? Password

  1. #1
    Join Date
    Sep 2013
    Beans
    3

    Lost? Password

    Hi Folks,

    I have not used the forum for while but now I have a problem that I cannot solve.

    I have a dual boot laptop W7Pro & Xubuntu 18.04 LTS

    But when I tried to login the other day, I cannot so, I tried to change the password using "physocats" method which I know works without any difficulty. In fact, I have helped several friends to enable them to login by using this method plus recovering my systems when I have forgotten the password, because I have several PCs, all with different passwords

    The problem is that when I select root i.e. Drop to root shell prompt, on the Recovery Menu, it transfers to root as normal but here is the rub,

    Give root password for maintenance
    (or press Control-D to continue
    i.e. asking for root password again (endless loop)
    I know that I may have forgotten my password, but as I can boot in the W7 partition using the same password, it is puzzling. Yes I know that is not good to do so but I use the same password for the W7 & the Xubuntu 18.04 LTS partitions. Also I not remember ever setting the Root password. Is there another way of removing the offending password. I have several bootable Live USB keys or should I say that they worked the last time I used them.

    Is there another way of removing/replacing the password file and/or the shadow file when using an external boot.

    Best Wishes
    Jim

  2. #2
    Join Date
    May 2010
    Beans
    1,697

    Re: Lost? Password

    If the root password is set then you will need to chroot from a live CD/USB OS. You can even use the Ubuntu install media for this.
    I suggest checking some YouTube videoa about chrooting. You will then be on as root, can set the user password as well as the root password if you want and reboot.

  3. #3
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Lost? Password

    Quote Originally Posted by Jim_Robinson View Post
    Hi Folks,

    I have not used the forum for while but now I have a problem that I cannot solve.

    I have a dual boot laptop W7Pro & Xubuntu 18.04 LTS

    But when I tried to login the other day, I cannot so, I tried to change the password using "physocats" method which I know works without any difficulty. In fact, I have helped several friends to enable them to login by using this method plus recovering my systems when I have forgotten the password, because I have several PCs, all with different passwords

    The problem is that when I select root i.e. Drop to root shell prompt, on the Recovery Menu, it transfers to root as normal but here is the rub,



    i.e. asking for root password again (endless loop)
    I know that I may have forgotten my password, but as I can boot in the W7 partition using the same password, it is puzzling. Yes I know that is not good to do so but I use the same password for the W7 & the Xubuntu 18.04 LTS partitions. Also I not remember ever setting the Root password. Is there another way of removing the offending password. I have several bootable Live USB keys or should I say that they worked the last time I used them.

    Is there another way of removing/replacing the password file and/or the shadow file when using an external boot.

    Best Wishes
    Jim


    If you can boot a Live USB, then simply mount your root partition and chroot to it. Assuming that /dev/sdb1 is your root partition:
    Code:
    sudo mount /dev/sdb1 /mnt
    sudo chroot /mnt
    From here you should be able to use the passwd command (as usual) to change your user's password and/or lock/change the root password.


    In case you don't have a working Live CD/USB, you can boot into a root shell with the init=/bin/bash kernel parameter.
    See: https://wiki.ubuntu.com/Kernel/KernelBootParameters

    EDIT:
    It was a long time ago when I used this technique, but I think I had to delete the quiet and splash parameters to get a functional root shell.
    Last edited by sisco311; July 7th, 2020 at 11:41 PM.

  4. #4
    Join Date
    Sep 2013
    Beans
    3

    Re: Lost? Password

    Hi Sisco311,

    Thanks for the instructions, they worked .
    But then I realised that I needed to remove my root password. So I googled and found some further information about removing the root password. I will detail them below. I have extended your instructions "Sisco331"

    Code:
    sudo mount /dev/sda5 /mnt
    sudo chroot /mnt
    
    Additional stages
    Edit password file
    
    cd /etc
    nano passwd
    
    Find root
    root:x:0:0:root:/root:/bin/bash
    Delete "x" therefore should look like
    
    root::0:0:root:/root:/bin/bash
    Save updated  file using 
    cntrl x
    y
    
    Edit shadow file a similar manner
    nano shadow
    locate root line but looks quite different
    
    root:$2qwer------until next :numbers:0:10000::::
    
    delete red section $2qwer------until next :numbers:0:10000 
    leaving only 4 colons
    
    root::::
    save 
    
    cntrl x
    y
    
    reboot
     using "pyschocats" method 
    grub menu
    recovery mode
    root note no request for root password
    mount o rw,remount /
    reset password
    passwd jim
    follow prompt note no feedback on screen re what you are typing in enter
    follow 2nd prompt and retype password enter
    if they match all is well
    exit
    at recovery menu select resume
    then OK
    Apologies about the long set of notes/instructions but they worked

    Thanks to all who replied.
    All I need to do now is mark it solved

    Best Wishes
    Jim

Bookmarks

Posting Permissions

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