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
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).
if know device name of partition contains ubuntu system's root filesystem, feel free skip step 5.
in ubuntu system (not live cd/dvd/usb system), run command in terminal:
mount | grep ' on / '
you should include spaces before
on
, after/
.that command produces
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
output. text beforeon
(not including space) device name of partition contains ubuntu system's root filesystem. remember (or write down).boot computer live cd/dvd/usb , select try ubuntu without installing (not install ubuntu).
open terminal window (ctrl+alt+t).
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
.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.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 usepasswd
command no arguments resetroot
'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 inchroot
or tell version live cd has), run:usermod -a -g sudo username
in ubuntu 11.10 , lower, administrative abilities conferred membership in
admin
group rathersudo
group. instead run:usermod -a -g admin username
in both cases, replace
username
name of user account want give admin powers.
run these 3 commands:
exit sudo umount /mnt exit
the last of commands quits terminal window.
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.)
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).
boot computer live cd/dvd/usb , select try ubuntu without installing (not install ubuntu).
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.
special videonauth explaining how open gparted in gnome 3, providing these screenshots.1on very old versions of ubuntu use gnome 2 instead of unity or unity 2d interface, open gparted top menu clicking system → administration → gparted 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.
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.
the partition contains ubuntu system's root filesystem large partition of type
ext4
(or old ubuntu systems,ext3
). there 1ext4
(orext3
) partition, or 1 big one. otherwise, 1 might/
partition (containing root filesystem, want) , other might/home
partition. if there 2 largeext4
orext3
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.
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.quit gparted.
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
Post a Comment