Re: [CentOS] Determine next UID number

2010-10-14 Thread John Kennedy
On Wed, Oct 13, 2010 at 17:16, Spiro Harvey wrote: > John Kennedy wrote: > > This also does not tell me how useradd knows that on this system at > > this time the highest UID assigned to a user is 20015. > > From the source's mouth (this is from useradd.c in the shadow-utils > package): > > /* >

Re: [CentOS] Determine next UID number

2010-10-13 Thread Les Mikesell
On 10/13/10 6:42 PM, Stephen Harris wrote: > On Wed, Oct 13, 2010 at 06:16:26PM -0500, Les Mikesell wrote: >> On 10/13/2010 6:01 PM, Stephen Harris wrote: >>> lastlog is a sparse file. How it looks and how big it is are two >>> different things. >> >> And how long it takes to copy if you back the

Re: [CentOS] Determine next UID number

2010-10-13 Thread Stephen Harris
On Wed, Oct 13, 2010 at 06:16:26PM -0500, Les Mikesell wrote: > On 10/13/2010 6:01 PM, Stephen Harris wrote: > > lastlog is a sparse file. How it looks and how big it is are two > > different things. > > And how long it takes to copy if you back the system up is a 3rd thing. Get better backup s

Re: [CentOS] Determine next UID number

2010-10-13 Thread Les Mikesell
On 10/13/2010 6:01 PM, Stephen Harris wrote: > >>> >>> Who says 4294967294 is out of range? > >> 64-bit, I presume? Does your /var/log/lastlog look pretty big after > > Nope; 32bit CentOS 5.5 > >> that person logs in or did that get fixed? > > lastlog is a sparse file. How it looks and how big it

Re: [CentOS] Determine next UID number

2010-10-13 Thread Stephen Harris
On Wed, Oct 13, 2010 at 05:45:15PM -0500, Les Mikesell wrote: > On 10/13/2010 5:24 PM, Stephen Harris wrote: > > On Wed, Oct 13, 2010 at 04:47:45PM -0400, John Kennedy wrote: > >> the next user even though some dim bulb gave a use a UID of 4294967294 (how > >> the hell that user can log in with a U

Re: [CentOS] Determine next UID number

2010-10-13 Thread Les Mikesell
On 10/13/2010 5:24 PM, Stephen Harris wrote: > On Wed, Oct 13, 2010 at 04:47:45PM -0400, John Kennedy wrote: >> the next user even though some dim bulb gave a use a UID of 4294967294 (how >> the hell that user can log in with a UID out of range is beyond me unless it >> gets truncated)... > > Who s

Re: [CentOS] Determine next UID number

2010-10-13 Thread Stephen Harris
On Wed, Oct 13, 2010 at 04:47:45PM -0400, John Kennedy wrote: > the next user even though some dim bulb gave a use a UID of 4294967294 (how > the hell that user can log in with a UID out of range is beyond me unless it > gets truncated)... Who says 4294967294 is out of range? # grep tstuser /et

Re: [CentOS] Determine next UID number

2010-10-13 Thread Bob Beers
On Wed, Oct 13, 2010 at 4:15 PM, John Kennedy wrote: > I am more looking at what the system thinks is the next UID. Does the > useradd command use this when it assigns the next UID? what about ... # useradd nextid; id -u nextid; userdel nextid -Bob __

Re: [CentOS] Determine next UID number

2010-10-13 Thread Paul Heinlein
On Wed, 13 Oct 2010, James A. Peltier wrote: > | > > That assumes the highest UID number has a login shell... > | > | > which is generally the case... > | > > | > | Exactly, without excluding those who have a shell of nologin the > | last uid on my machine is nfsnobody(65534), I don't believe tha

Re: [CentOS] Determine next UID number

2010-10-13 Thread Spiro Harvey
John Kennedy wrote: > This also does not tell me how useradd knows that on this system at > this time the highest UID assigned to a user is 20015. From the source's mouth (this is from useradd.c in the shadow-utils package): /* * find_new_uid - find the next available UID * * find_new_u

Re: [CentOS] Determine next UID number

2010-10-13 Thread James A. Peltier
- Original Message - | > > That assumes the highest UID number has a login shell... | | > which is generally the case... | > | > | Exactly, without excluding those who have a shell of nologin the last | uid on my machine is nfsnobody(65534), I don't believe that a UID can | be | greater

Re: [CentOS] Determine next UID number

2010-10-13 Thread Bowie Bailey
On 10/13/2010 4:42 PM, Rudi Ahlers wrote: > On Wed, Oct 13, 2010 at 10:40 PM, Bowie Bailey wrote: >> On 10/13/2010 4:22 PM, Terry Polzin wrote: >>> >>> LASTUID=`cat /etc/passwd |grep -v nologin|cut -d ":" -f 3 |sort -n | >>> tail -1`; NEXTUID=`expr $LASTUID + 1`; echo $NEXTUID >> That assumes th

Re: [CentOS] Determine next UID number

2010-10-13 Thread Terry Polzin
> > That assumes the highest UID number has a login shell... > which is generally the case... > > Exactly, without excluding those who have a shell of nologin the last uid on my machine is nfsnobody(65534), I don't believe that a UID can be greater than that. __

Re: [CentOS] Determine next UID number

2010-10-13 Thread m . roth
Bowie Bailey wrote: > On 10/13/2010 4:22 PM, Terry Polzin wrote: >> On Wed, 2010-10-13 at 20:09 +, Joseph L. Casale wrote: Is there an equivalent in CentOS? >>> cat /etc/passwd |cut -d ":" -f 3 |sort -n NEXTUID=`expr $LASTUID + 1` >>> >>> ;) >> LASTUID=`cat /etc/passwd |grep -v nologin|cu

Re: [CentOS] Determine next UID number

2010-10-13 Thread John Kennedy
On Wed, Oct 13, 2010 at 16:40, Bowie Bailey wrote: > On 10/13/2010 4:22 PM, Terry Polzin wrote: > > On Wed, 2010-10-13 at 20:09 +, Joseph L. Casale wrote: > >>> Is there an equivalent in CentOS? > >> cat /etc/passwd |cut -d ":" -f 3 |sort -n NEXTUID=`expr $LASTUID + 1` > >> > >> ;) > > LASTU

Re: [CentOS] Determine next UID number

2010-10-13 Thread Rudi Ahlers
On Wed, Oct 13, 2010 at 10:40 PM, Bowie Bailey wrote: >  On 10/13/2010 4:22 PM, Terry Polzin wrote: >> On Wed, 2010-10-13 at 20:09 +, Joseph L. Casale wrote: Is there an equivalent in CentOS? >>> cat /etc/passwd |cut -d ":" -f 3 |sort -n NEXTUID=`expr $LASTUID + 1` >>> >>> ;) >> LASTUID=`

Re: [CentOS] Determine next UID number

2010-10-13 Thread Bowie Bailey
On 10/13/2010 4:22 PM, Terry Polzin wrote: > On Wed, 2010-10-13 at 20:09 +, Joseph L. Casale wrote: >>> Is there an equivalent in CentOS? >> cat /etc/passwd |cut -d ":" -f 3 |sort -n NEXTUID=`expr $LASTUID + 1` >> >> ;) > LASTUID=`cat /etc/passwd |grep -v nologin|cut -d ":" -f 3 |sort -n | > t

Re: [CentOS] Determine next UID number

2010-10-13 Thread Terry Polzin
On Wed, 2010-10-13 at 20:09 +, Joseph L. Casale wrote: > > Is there an equivalent in CentOS? > > cat /etc/passwd |cut -d ":" -f 3 |sort -n NEXTUID=`expr $LASTUID + 1` > > ;) > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/m

Re: [CentOS] Determine next UID number

2010-10-13 Thread John Kennedy
On Wed, Oct 13, 2010 at 16:09, Joseph L. Casale wrote: > > Is there an equivalent in CentOS? > > cat /etc/passwd |cut -d ":" -f 3 |sort -n > > ;) > I am more looking at what the system thinks is the next UID. Does the useradd command use this when it assigns the next UID? John -- John Kennedy

Re: [CentOS] Determine next UID number

2010-10-13 Thread Joseph L. Casale
> Is there an equivalent in CentOS? cat /etc/passwd |cut -d ":" -f 3 |sort -n ;) ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

[CentOS] Determine next UID number

2010-10-13 Thread John Kennedy
When I used Solaris years and years ago there was a command that would be able to tell you the next available non-system UID number for the system (can't remember what it is now, I have slept since then...). Is there an equivalent in CentOS? Thanks, John -- John Kennedy _