[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ideas for mapping users to specific uids



On 04/21/2011 10:16 AM, Brad Alexander wrote:
I know the answer is going to be LDAP, but that's not really an option
for me.

I have, at work, a number of boxes with various users spread across our
network. And I have encountered this on several different jobs. In
essence, say you have four users, e.g. user1, user2, user3 and
user4...and for the sake of this problem, say there are 10 boxes, host 1
through host 5. User1 is the administrator for the network, so that
person has accounts on all 5 boxes. User2 has an account on box 2, 4 and
5, user3 has accounts on 1, 2 and 4, user 4 has accounts on 2, 4 and 5,
and box 3 is an NFS server.

What I would liike to do is set it up so user1 has uid 1000, user2,
1001, and so forth. Is there an easy way to set this up on my network
such that when I create a user, that user can have the same uid across
the board? Ideally, I would like to be able to subdivide the uid space
so that, say, admins are always 1000-1050, dbas are 1051-1075, users are
2000-2100, etc.

I know LDAP can do this, but at work, it is not an option, at least in
the short term...

Thanks,
--b

At install time I only create a single user (usually called user & with a uid of 1000 but that's not important) then I create my users like this

adduser --quiet --disabled-password --gecos Bob --uid 1020 --shell /bin/bash bob
then do something like
usermod -a -G dialout,cdrom,floppy,audio,video,plugdev,netdev,powerdev,lpadmin,mail,sasl,fuse,saned bob

I have a txt file with adduser and usermod lines ready to paste into a command prompt.

HTH hand etc...


Reply to: