List of all Debian system users and their UIDs

If none of the more specific forums is the right place to ask

List of all Debian system users and their UIDs

Postby VA1DER » 2019-06-16 23:41

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
VA1DER
 
Posts: 6
Joined: 2018-12-20 04:34

Re: List of all Debian system users and their UIDs

Postby GarryRicketson » 2019-06-17 00:29

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
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: List of all Debian system users and their UIDs

Postby VA1DER » 2019-06-17 19:04

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
VA1DER
 
Posts: 6
Joined: 2018-12-20 04:34

Re: List of all Debian system users and their UIDs

Postby Head_on_a_Stick » 2019-06-19 16:24

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).
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10613
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: List of all Debian system users and their UIDs

Postby linuxenthusiast » 2019-11-09 13:33

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
linuxenthusiast
 
Posts: 3
Joined: 2019-11-09 13:29


Return to General Questions

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable