Multiple *NIX Accounts with Identical UID

Posted by Tim on Server Fault See other posts from Server Fault or by Tim
Published on 2009-05-05T18:37:42Z Indexed on 2012/09/05 21:40 UTC
Read the original article Hit count: 260

Filed under:
|
|

I am curious whether there is a standard expected behavior and whether it is considered bad practice when creating more than one account on Linux/Unix that have the same UID. I've done some testing on RHEL5 with this and it behaved as I expected, but I don't know if I'm tempting fate using this trick.

As an example, let's say I have two accounts with the same IDs:

a1:$1$4zIl1:5000:5000::/home/a1:/bin/bash
a2:$1$bmh92:5000:5000::/home/a2:/bin/bash

What this means is:

  • I can log in to each account using its own password.
  • Files I create will have the same UID.
  • Tools such as "ls -l" will list the UID as the first entry in the file (a1 in this case).
  • I avoid any permissions or ownership problems between the two accounts because they are really the same user.
  • I get login auditing for each account, so I have better granularity into tracking what is happening on the system.

So my questions are:

  • Is this ability designed or is it just the way it happens to work?
  • Is this going to be consistent across *nix variants?
  • Is this accepted practice?
  • Are there unintended consequences to this practice?

Note, the idea here is to use this for system accounts and not normal user accounts.

© Server Fault or respective owner

Related posts about linux

Related posts about security