Reset UID/GID counter after vmail setup

529 views Asked by At

On my personal server, I recently made the move from Ubuntu Server 10.04 to Debian Wheezy 7.2. As part of that transition, I went from physical users/mailboxes to a virtual mailbox setup using dovecot+postfix+postfixadmin. In doing so, I created a vmail user with uid=5000 and gid=5000.

Now, whenever I create a new user it also gets set to uid=5001 and gid=5001. I'll eventually realize that this has happened and use webmin to set the uid/gid as appropriate. My understanding is that useradd looks at the "last" entry in passwd/group to determine the new uid/gid. However, I've made several new users (whose uid/gid were changed using webmin) so vmail is definitely not the last entry.

How can I "reset" the useradd counter? Or somehow ignore the vmail entry? I would like new users to get assigned uid and gid as if vmail didn't exist, so that I don't have to manually reassign them.

1

There are 1 answers

0
user3980321 On

You could change /etc/login.defs

UID_MAX and GID_MAX from default 60000 to 4999