Changed root password instead of user password with root locked. Now I can't log in.
Sorry if I am being really dumb, I'm super new to Arch so I don't know exactly what to do to fix it. A huge thanks to anyone who can help. (The user password was never changed from default, but I don't know what the default is and just hitting enter doesn't work)
About this post
- Posted
- Archived
- Score
- 0 · 100% up
- Kind
- Text
- ID
- 4de627
11 comments
Pop in the install-cd, mount your drive and chroot in. You're root and can change the passwords that way.
If you've forgotten some important passwords (eg: root, and your user account doesn't have sudo) you can add init=/bin/sh to the kernel boot args in your boot loader which will drop you into a shell with root access upon boot allowing you to set/change any passwords without having to resort to something like a full reinstall or trying to crack shadow.
Isn't this a major security flaw? O.O
You can secure it by adding a password to your bootloader, BIOS, and/or encrypting your drive. But it's otherwise by design. It's only really a risk if someone has physical access to the machine or has access via some remote terminal (not SSH) and if someone has physical access to your machine, most precautions you take aren't going to help anyway, especially if the attacker is sponsored by a government.
I was going to say add init=/bin/bash (or whatever your favorite shell is) to your bootloader, but sh would work as well. Then you can change the root password like normal. Also, this is much easier than getting a boot cd / live cd and then mounting your file system and doing a chroot.
Bit lost here, if you set the root password, just login with the root account? Then use passwd <user>
It is important to know about single user mode, is it is useful for rescuing your system from things like a forgotten root password. It also is a security risk if you are unaware of how it works, and think your box is safe when someone can touch it. http://www.linfo.org/single_user_mode.html
Some kernel parameters and what they do https://wiki.archlinux.org/index.php/kernel_parameters#Parameter_list
Deleted before we saved it.
Okay, I messed something up then, thanks!
get your install-usb/cd, mount your partitions and chroot in. passwd root to change
Boot a live OS and chroot to the Arch installation, then just run passwd!