Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

List of all Debian system users and their UIDs

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
VA1DER
Posts: 14
Joined: 2018-12-20 04:34

List of all Debian system users and their UIDs

#1 Post by VA1DER »

Is there a master list of all Debian system users and their UIDs? I want to create a new system user for a script, but before I do I want to see if there is an appropriate one I can reuse. I want to avoid reusing a UID that is used by another system user for software I don't have installed yet.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: List of all Debian system users and their UIDs

#2 Post by GarryRicketson »

Is there a master list of all Debian system users and their UIDs?
Yes there is, it is in /etc/passwd


I used these keywords:

Code: Select all

How to get   List of all Debian system users and their UIDs 
And do find a answer , actually , many very good answers, is your search engine broken ? Did you try that first ?
Since I do understand, in fact just the other day, my favourite search engine was literally broken, for real, I know that can happen, any way the first hit:
Shows various methods, but since you say:
I want to avoid reusing a UID that is used by another system user for software I don't have installed yet.
Probably this is most relevent:
From:https://linuxize.com/post/how-to-list-users-in-linux/Check whether a user exists in the Linux system
/etc/passwd
Now that we know how to list all users, to check whether a user exists in our Linux box we can simply filter the users’ list by piping the list to the grep command.

For example to find out if a user with name jack exists in our Linux system we can use the following command:

Code: Select all

getent passwd | grep jack 
Now I know, you will say, "But I said system users", yes I noticed that, but if you actually can read, and look at the page the link goes to, there is much more, including:
System and Normal Users

There is no real technical difference between the system and regular (normal) users. Typically system users are created when installing the OS and new packages. In some cases, you can create a system user that will be used by some application.

Normal users are the users created by the root or another user with sudo privileges. Usually, a normal user has a real login shell and a home directory.----snip------
It then goes on to show some commands that can be used for "system users" as well,...if that is not enough, try the key words your self, and try reading some of the other results, or maybe sometime someone else will have better answer then this one.
This one is pretty thorough, detailed:
https://www.cyberciti.biz/faq/linux-list-users-command/

User avatar
VA1DER
Posts: 14
Joined: 2018-12-20 04:34

Re: List of all Debian system users and their UIDs

#3 Post by VA1DER »

I meant all system users for all Debian packages, including packages I have perhaps not yet installed. When a Debian maintainer wants to add a new system user, that maintainer must be able to check a list of all UIDs assigned so that the newly assigned user doesn't conflict. I want to know where that list is maintained.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: List of all Debian system users and their UIDs

#4 Post by Head_on_a_Stick »

UIDs are part of the Linux Standard Base:
LSB wrote:23.3 User ID Ranges

The system User IDs from 0 to 99 should be statically allocated by the system, and shall not be created by applications.

The system User IDs from 100 to 499 should be reserved for dynamic allocation by system administrators and post install scripts using useradd.
https://refspecs.linuxfoundation.org/LS ... range.html

EDIT: I meant to post this in your other thread (which is about exactly the same thing).
deadbang

linuxenthusiast
Posts: 3
Joined: 2019-11-09 13:29

Re: List of all Debian system users and their UIDs

#5 Post by linuxenthusiast »

VA1DER wrote:I meant all system users for all Debian packages, including packages I have perhaps not yet installed. When a Debian maintainer wants to add a new system user, that maintainer must be able to check a list of all UIDs assigned so that the newly assigned user doesn't conflict. I want to know where that list is maintained.
There are multiple ways of knowing where the user ids may be stored on Linux.

You can indeed check the /etc/password file but there are some files on the filesystem that are also containing entries related to the Name Service Switch (nsswitch.conf)
This is where you might find information about where user ids are stored, sometimes there are stored in NIS for example.
Sites that I find useful :

Ask Ubuntu

It's FOSS

devconnected

Post Reply