Skip to content

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)

0 points10 comments
Open on Reddit
About this post
Posted
Archived
Score
0 · 100% up
Kind
Text
ID
4de627

Author

1
posts
4
comments
0
media
View profile

11 comments

Pop in the install-cd, mount your drive and chroot in. You're root and can change the passwords that way.

10 points

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.

3 points

Isn't this a major security flaw? O.O

1 points

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.

2 points

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.

1 points

Bit lost here, if you set the root password, just login with the root account? Then use passwd <user>

2 points
unknown author1 hidden

Deleted before we saved it.

1 points

Okay, I messed something up then, thanks!

1 points

get your install-usb/cd, mount your partitions and chroot in. passwd root to change

1 points

Boot a live OS and chroot to the Arch installation, then just run passwd!

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.