grub2 - How do I reset a lost password (using recovery mode requires me to type the password)? - Ask Ubuntu


i need reset password. have followed these steps:

how reset lost administrative password?

however, go "root" or "netroot" recovery options, tells me:

give root password maintenance (or type control-d continue) 

clearly, not know root password. if type control-d, return list of options. this page read:

under chapter 'the other way':

4. highlight line begins kernel , press 'e' edit` 

but in grub configuration file have no line starts kernel. only:

  • setparams 'ubuntu...'
  • recordfail
  • set gxfpayload...
  • insmod part_msdos
  • insmod ext2
  • set root=...
  • search --no-floppy...
  • linux /boot/vmlinuz-2.6.38...
  • initrd /boot/initrd.img-2.6....

those lines in grub. line should edit? or there way reset password?

since cannot access recovery mode, you'll have change password accessing installed ubuntu system live cd/dvd or live usb system. follows detailed walkthrough on how that.

this easiest if can use ubuntu system (even without administrative access). it's not harder if can't.

  • in experience, ubuntu users end locked out of own systems have automatic login enabled, how forget passwords (because don't have type them in log in). may or may not case in situation, have presented how if can use installed ubuntu system first because think people read post.

if can use installed ubuntu system, non-administrative user

  1. if don't have one, write ubuntu live usb flash drive (on ubuntu, windows, or mac os x), or burn ubuntu live cd/dvd (on ubuntu, windows, or mac os x).

  2. if know device name of partition contains ubuntu system's root filesystem, feel free skip step 5.

  3. in ubuntu system (not live cd/dvd/usb system), run command in terminal:

    mount | grep ' on / ' 

    you should include spaces before on , after /.

  4. that command produces /dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0) output. text before on (not including space) device name of partition contains ubuntu system's root filesystem. remember (or write down).

  5. boot computer live cd/dvd/usb , select try ubuntu without installing (not install ubuntu).

  6. open terminal window (ctrl+alt+t).

  7. run command:

    sudo mount /dev/sda1 /mnt

    replace /dev/sda1 device name of partition containing ubuntu system's root filesystem, if different.

    if error message how device or partition not exist or "unknown filesystem type," used wrong device name or partition number. explained above, system's root partition might not /dev/sda1.

  8. run command:

    sudo chroot /mnt 

    for purposes of being able reset password, or being able change groups users members of, that's need chroot in. in particular, you not need mount other filesystems /dev, /dev/pts, /sys, , /proc. more sophisticated chrooting procedures, allow use system chrooted into--for example, update , install software inside it--do require that, additional steps after entering chroot, not.

    if run sudo chroot /mnt , see message, means mounted wrong partition /mnt--remember, not /dev/sda1 on systems--though happen if deleted /bin/bash:

    chroot: failed run command ‘/bin/bash’: no such file or directory 

    if happen, can unmount sudo umount /mnt , proceed mount correct partition.

  9. perform 1 of these tasks, obtain/restore access install ubuntu system.

    • if want reset user's password:

      passwd username

      replace username username. (this username on system installed on hard drive, , not "ubuntu" username of default user on ubuntu desktop install cd.)

      enter password want user.

      • if don't know username, can list of users on system running:

        ls /home 

        this works because /home contains users' home directories, , name of user's home directory same name of user.

    • alternatively, if want set/reset root password:

      since you're in root shell, can use passwd command no arguments reset root's password:

      passwd 

      but please see this page, explains why having root account enabled not recommended in ubuntu.

    • alternatively, if want make user administrator (so can perform administrative actions including running commands root sudo):

      in ubuntu 12.04 , higher (you can run lsb_release -r see version of ubuntu have, make sure run in chroot or tell version live cd has), run:

      usermod -a -g sudo username

      in ubuntu 11.10 , lower, administrative abilities conferred membership in admin group rather sudo group. instead run:

      usermod -a -g admin username

      in both cases, replace username name of user account want give admin powers.

  10. run these 3 commands:

    exit sudo umount /mnt exit 

    the last of commands quits terminal window.

  11. reboot system clicking power icon on upper-right corner of screen , clicking shut down. (then click restart in dialog box comes up.) make sure remove cd/dvd or usb flash drive before system boots again, can ubuntu system on hard disk.

    • if you're running old enough ubuntu live cd there restart option in power menu, should click rather shut down.

if cannot use installed ubuntu system @ all

if can't log on obtain device name of partition contains ubuntu system's root filesystem, can figure out after booting live cd. there several ways this. present 1 here consider easiest , least lead mistakes. (however, may interested in this other method.)

  1. if don't have one, burn ubuntu live cd/dvd (on ubuntu, windows, or mac os x) or write ubuntu live usb flash drive (on ubuntu, windows, or mac os x).

  2. boot computer live cd/dvd/usb , select try ubuntu without installing (not install ubuntu).

  3. open gparted.

    • to in unity, default desktop environment in versions of ubuntu, click home button (i.e., button @ upper-left corner of screen ubuntu logo on it) or press super, known windows key. type in gparted. gparted come up, , can click it.

    • ubuntu 17.10 , later use gnome 3 gnome shell instead of unity. open gparted, click on grid of 9 dots appears on lower-left corner of screen open application panel. click on gparted icon.

      two screenshots of gnome 3 gnome shell in ubuntu 17.10 live environment, contributed videonauth, placed side side, hand-drawn markings added show button *applications panel*, gparted icon looks in applications panel. note icon labeled gparted, not necessary recognize appearance of icon.
      special videonauth explaining how open gparted in gnome 3, providing these screenshots.1

    • on very old versions of ubuntu use gnome 2 instead of unity or unity 2d interface, open gparted top menu clicking systemadministrationgparted partition editor.

    • other ubuntu flavors, ubuntu mate, xubuntu , lubuntu, have similar system of nested menus, through can access gparted while running them live usb or live cd/dvd.

  4. now can see partitions graphically. if have more 1 drive, may need select 1 contains ubuntu system, in drop-down menu @ upper-right corner of gparted.

  5. the partition contains ubuntu system's root filesystem large partition of type ext4 (or old ubuntu systems, ext3). there 1 ext4 (or ext3) partition, or 1 big one. otherwise, 1 might / partition (containing root filesystem, want) , other might /home partition. if there 2 large ext4 or ext3 partitions, can assume first 1 (shown farthest left) 1 contains system's root filesystem.

    this possibly wrong, nothing damaged these instructions if are. in other situations, outside actions described in post, not safe make assumption.

  6. remember, or write down, device name of partition (probably) contains root filesystem. gparted shows you. takes form /dev/sdxn x lower-case letter , n number.

  7. quit gparted.

  8. follow instructions above ("if can log on non-administrative user"), starting step 6.

these post adapted post #9, wrote, in this launchpad answers question.

1 credit goes videonauth explaining me how launch gparted in ubuntu 17.10 live environment. don't have gnome 3 , not have been able provide instructions otherwise. supplied both screenshots. (all added ugly hand-drawn arrow , circle.)


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User