Using live USB/CD : (using recovery mode)
Boot from live usb/cd and open terminal.
Use
gparted
orfdisk -l
to identify elementary OS partition from the list.The partition is just something like
/dev/sda1
Mount this somewhere (Be sure to select correct partition)
sudo mount /dev/sda10 /mnt
Note :
. In my system elementary OS partiton is
/dev/sda10
, replace it with yours.. If you have a
lvm
partiton, you need to mount it to/mnt/
Now run the following command as it is:
for d in dev sys run proc; do sudo mount --bind /$d /mnt/$d; done
Now become root of system,
sudo chroot /mnt
Set the password for the account:
passwd [user_name]
Now reboot
source here