Announcement

Collapse
No announcement yet.

Forgot my root password and can't login

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Forgot my root password and can't login

    How can I reset my root password? I can't remember. I haven't used the computer for a while, and can't remember other passwords as well.

    I tried to login with grub, but didn't find a way to log with grub.

    Thanks for help,

    #2
    One way is to log in with a "live" version then edit your user/password.

    A simple web search turns up many help pages:

    http://www.linuxandubuntu.com/home/h...word-in-ubuntu
    Last edited by SpecialEd; Jul 20, 2019, 11:07 PM.
    If you think Education is expensive, try ignorance.

    The difference between genius and stupidity is genius has limits.

    Comment


      #3
      Originally posted by SpecialEd View Post
      One way is to log in with a "live" version then edit your user/password.

      A simple web search turns up many help pages:

      http://www.linuxandubuntu.com/home/h...word-in-ubuntu
      The problem is how to get into the grub mode? The 'shift' key doesn't work for Kubuntu.

      Comment


        #4
        Originally posted by marlonmin View Post
        The problem is how to get into the grub mode?
        I presume you mean the grub menu. Also, I presume you mean your user password; Kubuntu normally does not have or use a root password (it inherits this behaviour from Ubuntu). On *buntus to get root we use sudo (or a GUI equivalent) and it asks for your user password.
        The 'shift' key doesn't work for Kubuntu.
        It's supposed to, I think, but I couldn't get it to work. (Maybe it's a timing thing, I tried hammering away to no avail.) Note that an askUbuntu post says it has to be the left shift key, maybe try that.

        To get to the grub menu I had to edit /etc/default/grub to set GRUB_TIMEOUT to some positive number, and then run sudo update-grub. But that's a catch-22 for you.

        (Edit, I've now tested the following, the bind mount stuff seems not to apply any more.)

        If you can boot to a Live USB or CD, you can use a chroot to set the password. Get to a bash prompt from the USB, and work out where the Kubuntu linux root is. One way to do that is to run sudo blkid. For a UEFI system it might well be /dev/sda2. (With btrfs the subvolume is needed, usually "@", so one would add -o subvol=@ to the mount command.)
        Code:
        sudo mount /dev/sda2 /mnt
        [s]for d in dev sys run proc; do sudo mount --bind /$d /mnt/$d; done # didn't work and it's not needed[/s]
        sudo chroot /mnt
        Now you can follow the instruction that apply after booting in recovery mode and remounting rw, namely
        Code:
        passwd [I]username[/I]
        substituting your user name.
        Last edited by jlittle; Jul 22, 2019, 07:54 AM. Reason: it didn't work
        Regards, John Little

        Comment


          #5
          Originally posted by marlonmin View Post
          The problem is how to get into the grub mode? The 'shift' key doesn't work for Kubuntu.
          Did you see the part about booting a "live" version?
          If you think Education is expensive, try ignorance.

          The difference between genius and stupidity is genius has limits.

          Comment


            #6
            Use the Esc key. Newer systems now use this instead of the shift key. You may have to try it a few times, some systems seem to have a very short window.

            Comment


              #7
              Yes, the 'ESC' key works. and Thank you all.

              Comment


                #8
                Originally posted by marlonmin View Post
                Yes, the 'ESC' key works. and Thank you all.
                That's great. It doesn't work for me, nor does left-shift. After about 5 attempts each, holding it down and a drum roll on the key. Ah well. I know well how to boot from USB, and change the grub time out value in the simplified grub.cfg I use.
                Regards, John Little

                Comment

                Working...
                X