#✅ Lost Ubuntu user password

1 messages · Page 1 of 1 (latest)

iron violet
#

I have lost Ubuntu 's password how can i recover it

plucky oxide
#

if it's not an encryption password then the recovery boot option might have something. basically you can boot to it as root and use it to change the user password

gritty wind
iron violet
#

Will the date be lost

gritty wind
#

If it’s the root password your changing boot an iso and chroot in, then do passwd if it’s a user password just log in to root on a tty and do passwd <user> replacing g <user> with the username you’re changing the password for

iron violet
#

how do I know if it is encrypted ?

gritty wind
#

basically chroot in, and if you can mount it and see what's inside, it's not encrypted

#

don't even need to chroot

#

just mount from the iso

#

if it's btrfs mount the subvol

#

wait, I know your next quesiton, 'how do I know if it's btrfs'
do lsblk -f

iron violet
#

i try th "mount -rw -o remount /" and
"passwd (username) "
some command suggestion come to line

gritty wind
#

lsblk -f

#

which one is your root?

#

look for /dev/<drive>

#

then mount /dev/<root drive> /mnt

#

replace <root drive> with that information

#

I'll give an example

#

The top one is /dev/sda1, and that is mounted at /boot/efi

#

so if it wasn't mounted and I wanted to mount it there it'd be mount /dev/sda1 /boot/efi

#

or if I was mounting sdb3, which is btrfs, I'd do this:
mount -t subvol=@ /dev/sdb3 /mnt
and then it would be mounted at /mnt

#

let me know if that makes sense @iron violet

iron violet
#

ah can you tell me the full process ?
i want to roots and type this command "mount -rw -o remount /"
and after that i write the "passwd (username)"

#

after that command suggestion come and i don't know what to do

iron violet
gritty wind
#

show me lsblk -f

iron violet
#

ok

#

hang on there for while

gritty wind
#

there are three types of file system you should be aware of:
vfat - for your bootloader, in your case almost definitely grub
ext4/btrfs/zfs etc. - your root, and if home is on its own partition, that as well
swap - used to supplement RAM, and is something that you need if you want your linux to hibernate

iron violet
#

also i can't access to ubuntu I hope you understand that

gritty wind
#

I don't think you'll be able to fix this easily without an ISO

#

I suppose you could boot up the ISO in a VM and attempt to pass your drive into the ISO, not sure how easy that would be though

iron violet
#

i didn't use it in the VM

gritty wind
#

I didn't say you did

plucky oxide
#

i don't know how if it's encrypted

gritty wind
#

I'm gonna try that now for my own machine, didn't know you could just do that

plucky oxide
#

I installed it to try that 😆

plucky oxide
#

the entire process?

iron violet
#

yes
but the problem is my father's user name has 3 word

#

that's the problem

plucky oxide
#

so you don't remember it?

#

or do you mean with spaces

gritty wind
plucky oxide
#

yeah the recovery thing is an Ubuntu

gritty wind
iron violet
#

what does that mean ?

gritty wind
#

how much experience do you have with linux?

iron violet
#

very little

gritty wind
#

is this machine yours or your dads?

iron violet
#

i use linux mint for 6 days

#

i but i wanted to learn linux

plucky oxide
#

ls /home after you're in the root menu, usually the username is the same as the home folder

gritty wind
#

but is the machine / system yours or your dads?

iron violet
#

my dads

honest tokenBOT
#

coco | windows received a thank you cookie!

gritty wind
iron violet
#

yep

#

my brother install the ubuntu so that my father can learn about linux but my father doesn't care about it and he forgets the password

gritty wind
#

and now you want to learn about linux?

iron violet
#

Yes

#

I always wanted but i thought ubuntu's password is strong so i didn't try it after few days ago i thought i should give it a try

gritty wind
#

okay, that's fine, just making sure you're not like, trying to hack your dad's laptop

iron violet
#

no no

#

my father's main work is in windows
and i can easily access it . there is nothing in ubuntu

gritty wind
#

I'll create an ubuntu VM just so I can go into the ISO after and help you change the passwords

gritty wind
#

I just want to thank ubuntu for telling me everything installed correctly and then doing this for bootup:

#

I'll try to get a response to you soon.

gritty wind
#

@iron violet what you can do is just get pretty much any linux iso I think, ubuntu or arch should be fine. If it's ubuntu, do the 'try it' option, might take some time to load, then load terminal and do lsblk -f and look for the root partition, if you don't know which it is post a picture, then do mount /dev/<root partition> /mnt and then chroot /mnt, and it's simply a case after that of doing:
passwd <user>
passwd <root>
they can have the same passwords if you want, and assuming you got a successful password change do: exit and then shutdown now remove the iso and then start the machine up and go into ubuntu.
If you use the arch iso you'll start in TTY (essentially terminal) and the above commands should still work, I don't know specifically what other ISO's look like

plucky oxide
#

install ubuntu and try my method EVILLUL

gritty wind
plucky oxide
#

no

plucky oxide
gritty wind
gritty wind
#

the chroot method needs no password unless the drive is encrypted

plucky oxide
#

yeah but it probably doesn't have a password. they said their issue was with the username being 3 words

gritty wind
#

root on ubuntu takes on password of user it was made with

plucky oxide
#

idk I installed it with the user as admin and it didn't require me for a root password to do the passwd part

plucky oxide
#

I just pressed enter when it asked for the password ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

gritty wind
plucky oxide
#

nope

gritty wind
#

as I said, ubuntu sets the root up with the same password as the user

#

that's why you could just press enter

gritty wind
plucky oxide
#

wait I'm trying it again

#

I said I didn't have to enter the password, not that I didn't install it with one

plucky oxide
gritty wind
#

I see the mis-communication now 🙂

plucky oxide
#

ok tried again. su didn't work with the user password so no root login, and in recovery mode I could press enter

plucky oxide
gritty wind
plucky oxide
#

yep

gritty wind
#

nevermind, you're right on that grub advanced options bit!

#

I suspect what caused an issue for me is that it happened after I reset both the user and root password manually

iron violet
gritty wind
iron violet
#

ok i will try this in when i will be free then i will give update about it

cold juniper
#

@iron violet boot an liveiso thru USB, open terminal, run
lsblk to get disk details, suppose your root partition is /dev/nvme0n1p1 you need to run

sudo mount /dev/nvme0n1p1 /mnt

next run

sudo su
mount --rbind /sys /mnt/sys && mount --make-rslave /mnt/sys

mount --rbind /proc /mnt/proc && mount --make-rslave /mnt/proc

mount --rbind /dev/ mnt/dev && mount --make-rslave /mnt/dev
chroot /mnt /bin/bash
passwd # this will change root password
passwd username # this will change password of your user
gritty wind
cold juniper
#

you need to mount psuedo fs afaik

gritty wind
cold juniper
#

good then 👍

iron violet
#

Thank you
Your method work @plucky oxide
Now i can enter Ubuntu

honest tokenBOT
#

coco | windows received a thank you cookie!

plucky oxide
#

yw

gritty wind
#

You should edit the title to say solved

iron violet
#

Ok

#

lost Ubuntu Password [Solved]