forgot user password & root password 16.04 [duplicate]












0
















This question already has an answer here:




  • How do I reset a lost administrative password?

    15 answers




i am very user of ubuntu, i have forgot my user & root's passwords now i am not able to login in my machine. I can login via guest user. please help me to reset password.



I tried to reset the password by recovery but after 3 steps. it starts asking me for "give root password for maintenance or press control-D".



I tried with another method by pressing "e" instead of "enter" by selecting ubuntu, with linux 4.4.0-140-generic (recovery mode). But the next window something very much different.



please help !










share|improve this question













marked as duplicate by Charles Green, PerlDuck, karel, N0rbert, Kulfy Jan 10 at 22:10


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    0
















    This question already has an answer here:




    • How do I reset a lost administrative password?

      15 answers




    i am very user of ubuntu, i have forgot my user & root's passwords now i am not able to login in my machine. I can login via guest user. please help me to reset password.



    I tried to reset the password by recovery but after 3 steps. it starts asking me for "give root password for maintenance or press control-D".



    I tried with another method by pressing "e" instead of "enter" by selecting ubuntu, with linux 4.4.0-140-generic (recovery mode). But the next window something very much different.



    please help !










    share|improve this question













    marked as duplicate by Charles Green, PerlDuck, karel, N0rbert, Kulfy Jan 10 at 22:10


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      0












      0








      0









      This question already has an answer here:




      • How do I reset a lost administrative password?

        15 answers




      i am very user of ubuntu, i have forgot my user & root's passwords now i am not able to login in my machine. I can login via guest user. please help me to reset password.



      I tried to reset the password by recovery but after 3 steps. it starts asking me for "give root password for maintenance or press control-D".



      I tried with another method by pressing "e" instead of "enter" by selecting ubuntu, with linux 4.4.0-140-generic (recovery mode). But the next window something very much different.



      please help !










      share|improve this question















      This question already has an answer here:




      • How do I reset a lost administrative password?

        15 answers




      i am very user of ubuntu, i have forgot my user & root's passwords now i am not able to login in my machine. I can login via guest user. please help me to reset password.



      I tried to reset the password by recovery but after 3 steps. it starts asking me for "give root password for maintenance or press control-D".



      I tried with another method by pressing "e" instead of "enter" by selecting ubuntu, with linux 4.4.0-140-generic (recovery mode). But the next window something very much different.



      please help !





      This question already has an answer here:




      • How do I reset a lost administrative password?

        15 answers








      password-recovery






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 10 at 15:50









      Sheetal DhirSheetal Dhir

      1




      1




      marked as duplicate by Charles Green, PerlDuck, karel, N0rbert, Kulfy Jan 10 at 22:10


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Charles Green, PerlDuck, karel, N0rbert, Kulfy Jan 10 at 22:10


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Boot from a USB (or CD/DVD if you have a system that old).



          You can then mount the partition with /etc/shadow and put a new password hash in. The easiest way to do that is copy from an existing shadow file for the user (root in this case).






          share|improve this answer































            0














            1. Start your machine in recovery mode -> resume normal boot. You should get a prompt with root. You need follow this steps:



            root@demo:~$ mount -o remount,rw /

            root@demo:~$ passwd yourusername
            Enter new UNIX password:
            Retype new UNIX password:
            passwd: password updated successfully

            root@demo:~$ reboot


            2. You can use chroot.
            Start your machine with Live CD/DVD/USB



            Start a terminal and mount your root disk like following steps



            # check what is your disk 
            ubuntu@demo:~$ sudo fdisk -l

            Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
            Units: sectors of 1 * 512 = 512 bytes
            Sector size (logical/physical): 512 bytes / 512 bytes
            I/O size (minimum/optimal): 512 bytes / 512 bytes
            Disklabel type: gpt
            Disk identifier: 083E1E28-FEE5-4BF0-B7CE-84520FB93B9D

            Disposit. Start Final Sectores Size Tipo
            /dev/sda1 2048 391167 389120 190M EFI System
            /dev/sda2 391168 58660699 58269532 27,8G Linux filesystem
            /dev/sda3 58660864 234440703 175779840 83,8G Linux filesystem

            # in this case my root disk is /dev/sda2
            ubuntu@demo:~$ mkdir disk
            ubuntu@demo:~$ sudo mount /dev/sda2 disk

            # you can check the files for ensure is root partition
            ubuntu@demo:~$ sudo ls disk
            bin dev home lib media proc sbin sys var
            boot initrd.img lib64 mnt root snap tmp vmlinuz
            cdrom etc initrd.img.old lost+found opt run srv usr vmlinuz.old

            ubuntu@demo:~$ sudo chroot disk


            # passwd for your username
            root@demo_chroot:~$ passwd yourusername
            Enter new UNIX password:
            Retype new UNIX password:
            passwd: password updated successfully


            #exit from chroot
            root@demo_chroot:~$ exit

            # finish umounting and reboot
            ubuntu@demo:~$ sudo umount disk





            share|improve this answer
































              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Boot from a USB (or CD/DVD if you have a system that old).



              You can then mount the partition with /etc/shadow and put a new password hash in. The easiest way to do that is copy from an existing shadow file for the user (root in this case).






              share|improve this answer




























                0














                Boot from a USB (or CD/DVD if you have a system that old).



                You can then mount the partition with /etc/shadow and put a new password hash in. The easiest way to do that is copy from an existing shadow file for the user (root in this case).






                share|improve this answer


























                  0












                  0








                  0







                  Boot from a USB (or CD/DVD if you have a system that old).



                  You can then mount the partition with /etc/shadow and put a new password hash in. The easiest way to do that is copy from an existing shadow file for the user (root in this case).






                  share|improve this answer













                  Boot from a USB (or CD/DVD if you have a system that old).



                  You can then mount the partition with /etc/shadow and put a new password hash in. The easiest way to do that is copy from an existing shadow file for the user (root in this case).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 10 at 16:04









                  Ed KingEd King

                  1861




                  1861

























                      0














                      1. Start your machine in recovery mode -> resume normal boot. You should get a prompt with root. You need follow this steps:



                      root@demo:~$ mount -o remount,rw /

                      root@demo:~$ passwd yourusername
                      Enter new UNIX password:
                      Retype new UNIX password:
                      passwd: password updated successfully

                      root@demo:~$ reboot


                      2. You can use chroot.
                      Start your machine with Live CD/DVD/USB



                      Start a terminal and mount your root disk like following steps



                      # check what is your disk 
                      ubuntu@demo:~$ sudo fdisk -l

                      Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
                      Units: sectors of 1 * 512 = 512 bytes
                      Sector size (logical/physical): 512 bytes / 512 bytes
                      I/O size (minimum/optimal): 512 bytes / 512 bytes
                      Disklabel type: gpt
                      Disk identifier: 083E1E28-FEE5-4BF0-B7CE-84520FB93B9D

                      Disposit. Start Final Sectores Size Tipo
                      /dev/sda1 2048 391167 389120 190M EFI System
                      /dev/sda2 391168 58660699 58269532 27,8G Linux filesystem
                      /dev/sda3 58660864 234440703 175779840 83,8G Linux filesystem

                      # in this case my root disk is /dev/sda2
                      ubuntu@demo:~$ mkdir disk
                      ubuntu@demo:~$ sudo mount /dev/sda2 disk

                      # you can check the files for ensure is root partition
                      ubuntu@demo:~$ sudo ls disk
                      bin dev home lib media proc sbin sys var
                      boot initrd.img lib64 mnt root snap tmp vmlinuz
                      cdrom etc initrd.img.old lost+found opt run srv usr vmlinuz.old

                      ubuntu@demo:~$ sudo chroot disk


                      # passwd for your username
                      root@demo_chroot:~$ passwd yourusername
                      Enter new UNIX password:
                      Retype new UNIX password:
                      passwd: password updated successfully


                      #exit from chroot
                      root@demo_chroot:~$ exit

                      # finish umounting and reboot
                      ubuntu@demo:~$ sudo umount disk





                      share|improve this answer






























                        0














                        1. Start your machine in recovery mode -> resume normal boot. You should get a prompt with root. You need follow this steps:



                        root@demo:~$ mount -o remount,rw /

                        root@demo:~$ passwd yourusername
                        Enter new UNIX password:
                        Retype new UNIX password:
                        passwd: password updated successfully

                        root@demo:~$ reboot


                        2. You can use chroot.
                        Start your machine with Live CD/DVD/USB



                        Start a terminal and mount your root disk like following steps



                        # check what is your disk 
                        ubuntu@demo:~$ sudo fdisk -l

                        Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
                        Units: sectors of 1 * 512 = 512 bytes
                        Sector size (logical/physical): 512 bytes / 512 bytes
                        I/O size (minimum/optimal): 512 bytes / 512 bytes
                        Disklabel type: gpt
                        Disk identifier: 083E1E28-FEE5-4BF0-B7CE-84520FB93B9D

                        Disposit. Start Final Sectores Size Tipo
                        /dev/sda1 2048 391167 389120 190M EFI System
                        /dev/sda2 391168 58660699 58269532 27,8G Linux filesystem
                        /dev/sda3 58660864 234440703 175779840 83,8G Linux filesystem

                        # in this case my root disk is /dev/sda2
                        ubuntu@demo:~$ mkdir disk
                        ubuntu@demo:~$ sudo mount /dev/sda2 disk

                        # you can check the files for ensure is root partition
                        ubuntu@demo:~$ sudo ls disk
                        bin dev home lib media proc sbin sys var
                        boot initrd.img lib64 mnt root snap tmp vmlinuz
                        cdrom etc initrd.img.old lost+found opt run srv usr vmlinuz.old

                        ubuntu@demo:~$ sudo chroot disk


                        # passwd for your username
                        root@demo_chroot:~$ passwd yourusername
                        Enter new UNIX password:
                        Retype new UNIX password:
                        passwd: password updated successfully


                        #exit from chroot
                        root@demo_chroot:~$ exit

                        # finish umounting and reboot
                        ubuntu@demo:~$ sudo umount disk





                        share|improve this answer




























                          0












                          0








                          0







                          1. Start your machine in recovery mode -> resume normal boot. You should get a prompt with root. You need follow this steps:



                          root@demo:~$ mount -o remount,rw /

                          root@demo:~$ passwd yourusername
                          Enter new UNIX password:
                          Retype new UNIX password:
                          passwd: password updated successfully

                          root@demo:~$ reboot


                          2. You can use chroot.
                          Start your machine with Live CD/DVD/USB



                          Start a terminal and mount your root disk like following steps



                          # check what is your disk 
                          ubuntu@demo:~$ sudo fdisk -l

                          Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
                          Units: sectors of 1 * 512 = 512 bytes
                          Sector size (logical/physical): 512 bytes / 512 bytes
                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                          Disklabel type: gpt
                          Disk identifier: 083E1E28-FEE5-4BF0-B7CE-84520FB93B9D

                          Disposit. Start Final Sectores Size Tipo
                          /dev/sda1 2048 391167 389120 190M EFI System
                          /dev/sda2 391168 58660699 58269532 27,8G Linux filesystem
                          /dev/sda3 58660864 234440703 175779840 83,8G Linux filesystem

                          # in this case my root disk is /dev/sda2
                          ubuntu@demo:~$ mkdir disk
                          ubuntu@demo:~$ sudo mount /dev/sda2 disk

                          # you can check the files for ensure is root partition
                          ubuntu@demo:~$ sudo ls disk
                          bin dev home lib media proc sbin sys var
                          boot initrd.img lib64 mnt root snap tmp vmlinuz
                          cdrom etc initrd.img.old lost+found opt run srv usr vmlinuz.old

                          ubuntu@demo:~$ sudo chroot disk


                          # passwd for your username
                          root@demo_chroot:~$ passwd yourusername
                          Enter new UNIX password:
                          Retype new UNIX password:
                          passwd: password updated successfully


                          #exit from chroot
                          root@demo_chroot:~$ exit

                          # finish umounting and reboot
                          ubuntu@demo:~$ sudo umount disk





                          share|improve this answer















                          1. Start your machine in recovery mode -> resume normal boot. You should get a prompt with root. You need follow this steps:



                          root@demo:~$ mount -o remount,rw /

                          root@demo:~$ passwd yourusername
                          Enter new UNIX password:
                          Retype new UNIX password:
                          passwd: password updated successfully

                          root@demo:~$ reboot


                          2. You can use chroot.
                          Start your machine with Live CD/DVD/USB



                          Start a terminal and mount your root disk like following steps



                          # check what is your disk 
                          ubuntu@demo:~$ sudo fdisk -l

                          Disk /dev/sda: 111,8 GiB, 120034123776 bytes, 234441648 sectors
                          Units: sectors of 1 * 512 = 512 bytes
                          Sector size (logical/physical): 512 bytes / 512 bytes
                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                          Disklabel type: gpt
                          Disk identifier: 083E1E28-FEE5-4BF0-B7CE-84520FB93B9D

                          Disposit. Start Final Sectores Size Tipo
                          /dev/sda1 2048 391167 389120 190M EFI System
                          /dev/sda2 391168 58660699 58269532 27,8G Linux filesystem
                          /dev/sda3 58660864 234440703 175779840 83,8G Linux filesystem

                          # in this case my root disk is /dev/sda2
                          ubuntu@demo:~$ mkdir disk
                          ubuntu@demo:~$ sudo mount /dev/sda2 disk

                          # you can check the files for ensure is root partition
                          ubuntu@demo:~$ sudo ls disk
                          bin dev home lib media proc sbin sys var
                          boot initrd.img lib64 mnt root snap tmp vmlinuz
                          cdrom etc initrd.img.old lost+found opt run srv usr vmlinuz.old

                          ubuntu@demo:~$ sudo chroot disk


                          # passwd for your username
                          root@demo_chroot:~$ passwd yourusername
                          Enter new UNIX password:
                          Retype new UNIX password:
                          passwd: password updated successfully


                          #exit from chroot
                          root@demo_chroot:~$ exit

                          # finish umounting and reboot
                          ubuntu@demo:~$ sudo umount disk






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jan 10 at 22:09

























                          answered Jan 10 at 22:03









                          James SJames S

                          413




                          413















                              Popular posts from this blog

                              Human spaceflight

                              Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                              張江高科駅