Monday, April 29, 2024
42
rated 0 times [  42] [ 0]  / answers: 1 / hits: 61561  / 2 Years ago, sat, april 23, 2022, 2:32:12

My understanding of UIDs is that is a unique positive integer assigned by a Unix-like operating system to each user. Each user is identified to the system by its UID, and user names are generally used only as an interface for humans.



How can two users have the same UID, isn't this a conflict for my system and packages?



root@kdc:~# id test12
uid=1005(test10) gid=1000(server) groups=1005(test10)
root@kdc:~# id test13
uid=1005(test10) gid=1000(server) groups=1005(test10)
root@kdc:~#


I've added two users with same UID and GID: test12 and test13



The output of /etc/passwd:



client@kdc:~$ cat /etc/passwd | grep test12
test12:x:1005:1000::/home/test12:/bin/sh
client@kdc:~$ cat /etc/passwd | grep test13
test13:x:1005:1000::/home/test13:/bin/sh


I added the users by useradd -ou 1005 -g1000 username.



I got confused what is the purpose of this, and can it affect permissions and user logs etc. So now if a user is added with uid=0 and gid=0 will has privileges like a root account?


More From » user-management

 Answers
5

The answer here is that Linux does not protect you from yourself.



If you really want to su root and go into the /etc files and give all the users the same UID, you can. It's just a text file.



But you really shouldn't and it will have unintended consequences.


[#26774] Sunday, April 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scusaper

Total Points: 335
Total Questions: 111
Total Answers: 119

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
;