Score:0

Why would userdel report that a user is currently used by a process that is running as another user?

au flag

When attempting to delete userA, userdel reported that userA is currently used by process 1296; however, ps reported that this process was running as userB. userC ran userdel.

userdel: user **userA** is currently used by process 1296
(base) **userC**@server:/dir1/home$ ps -aux | grep 1296
**userB**  1296  0.0  0.0  21604  5096 pts/0    Ss   Jan02   0:00 /bin/bash -l

Distro name and version:

(base) userB@server:~$ uname -a Linux server 4.15.0-135-generic #139-Ubuntu SMP Mon Jan 18 17:38:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

(base) userB@server:~$ id userA uid=1000(userA) gid=1000(userA) groups=1000(userA)

(base) userB@server:~$ id userB uid=000000(userB) gid=000000(userB) groups=000000(userB),00(sudo),000(lxd),000(libvirt),0000000(groupB),00000(groupB)

NB: The number of 0s reflects the number of digits in the number.

br flag
Please provide more information such as: Distro name and version, output of `id usera` and `id userb`, `ps -aux --forest` output of the entire tree that 1296 exists in, and an `strace` of the `userdel`
jp flag
It is possible that both `userA` and `userB` have the same UID.
br flag
When I attempt to do make that happen manually with useradd, I get an error that the UID is already in use. Stackhatter could have manually edited their /etc/passwd to have two users with the same UID, but in this case I am not able to replicate the original error message from the OP on my Alpine test VM, which is why I also asked for distro name and version.
stackhatter avatar
au flag
Process 1296 has been killed; hence, we cannot provide the other requested details on it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.