You are not logged in.

#1 2026-02-27 02:12:36

123h456i098
Member
Registered: 2026-02-27
Posts: 2

Unable to mount root to change password

So I started off playing with pacdirr, which I know understand was probably not good, and I managed to overwrite passwrd, which from what I have now looked at means that I dont have a password anymore.

I am currently trying to create a password by booting off a live CD, and then mounting onto the root and then changing the password as suggested by the wiki. However when I run "passwd --root /mnt glompson" it says cannot determine your username which i think is different from the username not existing?

Any advice for how to proceed?

P.s I seem to be unable to provide screenshots as i am currently working off my phone

Last edited by 123h456i098 (2026-02-27 02:14:35)

Offline

#2 2026-02-27 02:21:01

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,584

Re: Unable to mount root to change password

If you overwrote passwd, you don't have an account anymore. If you overwrote shadow, that would be your password. You need to recreate your account with the same UID you had before.

Offline

#3 2026-02-27 02:27:11

123h456i098
Member
Registered: 2026-02-27
Posts: 2

Re: Unable to mount root to change password

Sorry for being dense but what is an UID? And how would I find what the original one was?

Last edited by 123h456i098 (2026-02-27 02:30:42)

Offline

#4 2026-02-27 04:27:22

Fool4U
Member
Registered: 2026-02-25
Posts: 2

Re: Unable to mount root to change password

123h456i098 wrote:

Sorry for being dense but what is an UID? And how would I find what the original one was?

UID is the user identifier. 0 is for root and usually 1000 is the id for normal users that is unless u made some changes though u can probably find them in the logs
Anyways wish u luck ✌?

Offline

#5 2026-02-27 11:23:27

ArchEr9
Member
Registered: 2025-03-18
Posts: 39

Re: Unable to mount root to change password

123h456i098 wrote:

Sorry for being dense but what is an UID? And how would I find what the original one was?

UID = User ID. A number. Typically accounts having UID <= 999 are created by system. Accounts created by UID >=1000 are created by users.
All the users created by Linux system have this ID. For example root will have the UID of "0" (ZERO).

So boot of the live CD and do the following
1) Create a directory /mnt/homepartition and /mnt/rootPartition.
2) Mount the /home and / partition into /mnt/homepartition and /mnt/rootPartition respectively
3) run the command ls -alp homepartition

The output will show your the user id and group id.

If you have by accident overwritten /etc/passwd file then the best course of action would be to take a backup of the user data and  reinstall Arch.

Offline

Board footer

Powered by FluxBB