Can login to root only. cat passwd shows root
0:0::/root:/usr/bin/bash only.
Welcome back @vogle.
What event may have preceded this development?
pacnew files overwrite =) , first time encountered this in arch-update. wrong option of course.
If you look inside /etc/passwd- (note the hyphen - on the end!), can you see your missing user accounts?
cat passwd- and cat passwd is same
root
0:0::/root:/usr/bin/bash
This person also encountered this using arch-update:
https://www.reddit.com/r/archlinux/comments/1bt7x05/archupdate_deleted_my_usr_how_to_fix/
I’d never even heard of arch-update before this. Given its wiped all the user accounts except root, I’d suggest a backup and re-install from scratch.
Maybe, use a more common tool instead of arch-update too. eos-update or yay perhaps.
Perhaps someone more seasoned could offer a non-reinstall option.
This worked so far:
-
Identify the old UID/GID: Check the ownership of the existing home directory to match the new user IDs: ls -l /home/
-
2. Create or Update Users
If the user account does not exist yet, create it with the specific UID to match the existing folder:
-
To create a user with a specific UID (e.g., 1001):
sudo useradd -u 1001 -g 1001 -m -d /home/username username -
2. Create or Update Users to Match UIDs
If the users don’t exist yet, create them with the specific UID and point them to the existing directory. If they do exist, modify them.
-
To create a new user with specific UID 1000:
sudo useradd -u 1000 -d /home/<folder_name> -M <username>.
(Note:-Mprevents creating a new directory if it already exists). -
Set Ownership:
Run these commands for both users to ensure the files match their new UIDs.-
sudo chown -R 1000:1000 /home/<folder_1000>. -
sudo chown -R 1001:1001 /home/<folder_1001>.
-
-
Set Permissions:
The standard Arch Linux home directory permission is 700 (owner-only access) or 755 (publicly readable but only owner-writable).sudo chmod 700 /home/<folder_name>.
4. Verify the Configuration
Check that everything is synced:
-
Verify file ownership:
ls -l /home. -
Verify user identity:
id <username>.
-
-
That recreates a user.
Your /etc/passwd file however, likely contained dozens of user accounts necessary for system operation. Mine for example, contains 4 dozen user accounts for various services.