1758607 Members
2288 Online
108873 Solutions
New Discussion юеВ

Re: /etc/passwd

 
Domenico_5
Respected Contributor

/etc/passwd

Hi guys

I have a litte question about /etc/passwd.

how many record i can create on it? I know that I can use LDAP or other authentication method, but I must use passwd for a test and I need to create a lot of record (10000)

someome know the limit?

tnx
8 REPLIES 8
Peter Godron
Honored Contributor

Re: /etc/passwd

Domenico,
no limit, as long as each user has his/her own ID.
But be aware if you are trying to get all these users to log on:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=40120
Pete Randall
Outstanding Contributor

Re: /etc/passwd

According to "man 5 limits", UID_MAX is at least 2147483647 which would allow over 2 billion users.


Pete

Pete
Peter Nikitka
Honored Contributor

Re: /etc/passwd

Hi,

no, there is no limit for entries in this file, but nevertheless:
- if you need this for a test, use another filename containing the syntax of /etc/passwd only.
- for seeking a linear search is done on the file
- uids are usually below 65536

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Deoncia Grayson_1
Honored Contributor

Re: /etc/passwd

this will help you in your research:
pay close attention to maxusers kernel parameter...

http://www.docs.hp.com/en/939/KCParms/KCparam.MiscParamsOverview.html
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Peter Nikitka
Honored Contributor

Re: /etc/passwd

Hi,

I may add, that UIDs need not be different - there may be 'aliases' with different usernames.
I remember especially the (ab)use of more that one root-ID.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
A. Clay Stephenson
Acclaimed Contributor

Re: /etc/passwd

There really is no limit and I have managed systems that had tens of thousands of users. The passwd and group file searches are linear so that on average n/2 accesses will be needed to locate a given user. The good news is that your system does illustrate a valid use for the passwd/group caching daemon (pwgrd). This daemon answers requests from the various getpwuid() and getgrid() functions (as well as all of their cousins) so that the actual files need not be read directly and intelligent caching decision can be made for the more frequently used UID's and GID's. This daemon should address any concerns related to a seemingly large passwd file.
If it ain't broke, I can fix that.
Ivan Azuara
Regular Advisor

Re: /etc/passwd

As an other member says, doesn├В┬┤t exist a limit for the number of users on the system. The maxusers parameter doesn├В┬┤t has relation with the total of users. This parameter is a macro for modify an other parameters.

Be care with the manage of the /etc/group because if your users have a lot of secondary groups, its posible that the /etc/group file will be corrupted (Exist a kernel limitation in the line size).

LFOD !
"Enjoy the life .."
Bill Hassell
Honored Contributor

Re: /etc/passwd

Just a couple of notes about /etc/group:

1. You don't have to write a massively long line for a group ID with thousands of users. Just put 8 or 10 user names on one line, then create a new line with the same GID and add more users. There is no limit to the number of lines (or the order) for the same GID.

2. You don't need to identify the user's primary GID because that is in the passwd file. So the only entries needed in /etc/group are for secondary group memberships. And for documentation for the ll command, make sure all group names are listed even if there are no members. Without these entries, the GID will be a number in the ll command.


Bill Hassell, sysadmin