Change UID of account

I’ve been debugging why I can write to an SMB share from one client and not from another, and I’ve discovered that I have two user accounts with the same UID (not saying that this is the root cause of my problem). I know that in some special circumstances that this can be a useful thing to do, but it my case it was accidental (No idea how/when it happened, but obviously I did “something”).

Is it possible to change the UID of an account without deleting and re-creating it?

You can’t seem to do this via the GUI, so I tried using vipw to edit the passwd file, but after a reboot nothing has changed.

No. It’s intrinsically tied to the account. Delete and recreate.

1 Like

I’m guessing that once I delete one of the accounts, that the files associated with that account will be orphaned with a UID like 1000, and that after I create the new account I simply chown everything?

I just deleted one of the accounts. But the username from that account is still in the /etc/passwd file, which appears to be blocking me from re-creating it.

When I try to recreate the account using the previous name, I get a red warning on the GUI stating “The name is already in use.”

So, how do I purge that name from the system so I can re-create it?

FWIW this is on TrueNAS-13.0-U6.1