I overwrote /etc/shadow... how do I recover from this?
Well, I (stupidly) let yay overwrite the /etc/shadow file and now I can’t login. How do I proceed to get my computer working again?
E: that was... easier than I expected. I just followed these steps from the wiki. That seems insecure but hey it works I guess.
Edited 13 May 2020. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 5 · 100% up
- Kind
- Text
- ID
- gioyqa
13 comments
Deleted before we saved it.
Ah thank you! You were right that I was missing them but the backup helped :)
If someone has physical access to your unencrypted machine, it is not safe. This is what full disk encryption is for.
Makes sense, thanks! I’m going to try setting up full disk encryption next week but I’ve been waiting for my semester to end just in case I mess anything up.
Very good thought, I would also not do any system updates. I once was screwed over by a reboot. Not gonna do that again if I need the machine to work in the next few hours.
Boot arch install media, chroot into your old install and change your password
Thanks! I realized you commented right as I edited my post, so I didn't actually see you reply before. I ended up just following the password recovery steps from the wiki with appending
init=/bin/bashto my grub entry and using passwd to change the password, since I don't have full-disk encryption right now.And all that because Mr Poettering suggested to set an invalid root password instead of an empty one in the default shadow file that's installed by the filesystem package ;). Bashing incoming in... https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/filesystem&id=0320c909f3867d47576083e853543bab1705185b
really? so you're saying that what he proposed overwrote the /etc/shadows for this dude? what about rest of the arch users? didn't happen to me...
No, pacman notices this and installs it as shadow.pacnew but his "helper" overwrote it because he told it to do so. I wrote this comment rather as an explanation why this file had to be updated in the first place (and this was not an accusation in any way, this fix is important if you create a user account during installation directly in the chroot and forget to do a "passwd root" before you reboot; you don't want that passwordless root account).
Edit: There's a post about it: https://www.reddit.com/r/archlinux/comments/giue3c/default_root_login/