How to change forgotten Linux password

preview_player
Показать описание
This goes over resetting ANY Linux password and two methods of doing so. .

Рекомендации по теме
Комментарии
Автор

It should be noted that if you use LUKS drive encryption... NONE of these methods will work as the information can't be mounted without the encryption key.

ChrisTitusTech
Автор

There is a third way: If you get into GRUB and go into the edit mode. Then you'd need to go to the line where it says "linux" and go to the far end. Then you add "init=/bin/sh" to it and if you then boot you'll get directly into a shell with root permissions (if the drive isn't encrypted)

Larslol
Автор

you can also insert the hash of a password into the /etc/shadow file. If you have access to the hard-drive

anastassogoldschmied
Автор

One more reason to encrypt your disk/s using luks

CryNomadsis
Автор

Many thanks for sharing this Chris, this has been a lifesaver when trying to access some old Linux VMs I have where I lost the password.

thebozzIDW
Автор

thanks a lot Chris, i was about to reinstall my debian virtual box, and i forgot i could use an arch iso, i forgot once to edit the sudo file on the arch linux config and i booted up the iso to fix it, but it didn't came to my mind i could use the passwd command to reset the password👍

commandprompt
Автор

Hey, Chris, you just saved me with single user mode. I didn't need to change a password, but there was something messed up with sddm not having any sessions and not being able to get to a tty because it kept kicking me back to sddm. In this case, after _quiet_ I had to use _init=/bin/bash_ to enter single user mode, but it at least let me disable my sddm service until I can repair it properly.

dsouth
Автор

Nice! Back then, I did something somewhat similar in Windows XP by I think pressing Ctrl + Alt + Delete on the login screen and it went to the old fashioned one where you can manually type in user and password. I did the Administrator account without a password assigned to it and was able to reset stuff in that account normally.

zinsy
Автор

Chris love your videos I have no doubt after I will be using this throughout my infosec career

OneManCanStopTheMotorOfWorld
Автор

I never knew until my senior sysadmin taught me 😃. I was like 🤯

johnzavax
Автор

Passwords are just simply entries in a text file and are easy to change. The only problem is that Linux also uses your password to encrypt some things like your keyring/password store, if you use that. This is probably not an issue for root but definitely for regular accounts.

BenderdickCumbersnatch
Автор

First thing came to my mind when I saw the title was arch-chroot :)

stefans
Автор

I've actually used that second technique on a client computer who forgot their root user password. It's actually a nice hidden secret because with it, you could LITERALLY break into any users system with this technique.

Phydoux
Автор

Had to do it for a windows machine using a bootable USB, felt so cool

yuvaldahan
Автор

If my system is encrypted I will not be able to use this method right?

parker
Автор

I was dual booting Windows and Manjaro recently and accidentally wiped the Manjaro bootloader. I used that chroot technique to re-install Grub so I could log back in. I used to think it was pronounced: shuh-root !

plica
Автор

Thanks for this awesome video. Hey can you share that grub theme. its look so cool...

Noir_SD
Автор

do you even need to mount the boot partition? I think you only need to chroot to /

QuimChaos
Автор

that's why encryption is essential 😎

jadnouri
Автор

Awesomeness. Much needed information. And another pro to linux... versatility.

geraldrector
visit shbcf.ru