I'm on a NAS and had been running some YAMLs. I have a user ID johnG(1042) G(100) which was used for the YAML. There were some updates along, and I'm not sure how it happened but suddenly it changed to abc(1042) G(100). Now both names exist with the same ID and Group. I did not make the change knowingly and no one else has access to the NAS. Everything seems to be running, but I don't want to wait until there is an issue. How do I get rid of that second name to the same id?
1 Answer
Not a great deal to go on in your question, but using experience to fill in some gaps, it sounds like you have a couple of entries in your /etc/passwd roughly looking like this:
johnG:x:1042:100::/home/johnG:/bin/bash abc:x:1042:100::/home/abc:/bin/bash Assuming this to be the case, in practice I would not expect a duplicate UID to cause any particular problems, except that the OS will only report one of johnG and abc as the owner of things
[root@1c0a37124afc /]# ll /home total 8 drwx------ 2 johnG users 4096 Aug 21 16:19 abc drwx------ 2 johnG users 4096 Aug 21 16:18 johnG Assuming you don't want abc (and that your NAS has some common tooling available), you could remove it (and its home directory) like so
userdel --remove abc - If I've not hit the nail on the head with my assumptions here, please update the question with more information.bxm– bxm2024-08-21 16:24:17 +00:00Commented Aug 21, 2024 at 16:24
- Hey bxm. You sledgehammered it on the head. Apologies for the lack of clarity on my part. I'm just a couple of rungs up above newb. OK so I can relax knowing it won't cause an issue. But how is it even possible that could happen? And would userdel-- remove abc carry a potential problem, in regards to the app(s) it's tied in to. I did notice as I was trying to understand the issue that in some instances using SSH that it recognized johnG's existence and not abc and vice versa. Thank you!Chuck Farley– Chuck Farley2024-08-21 20:34:03 +00:00Commented Aug 21, 2024 at 20:34
- It's difficult to say if it would cause issues if there are "app(s) it's tied in to" (perhaps you can clarify that with a question edit). I would attempt to unpick such tie-ins if you can before removing the user. Worst case, you can always re-add the
abc, withuseradd abc -u 1042 -o. Alternatively you could probably just leave it all alone.bxm– bxm2024-08-24 20:33:34 +00:00Commented Aug 24, 2024 at 20:33 - 1Different tools might report
johnGorabc, and may do so inconsistently, it likely depends on how they enumerate the accounts and/or store of copy that information.bxm– bxm2024-08-24 20:35:51 +00:00Commented Aug 24, 2024 at 20:35