OSX numeric UIDs - any control over them?

johnnyb

Registered
Hello All

Couple quick questions:

* Is there any way to specify a numeric UID and/org GID at user creation time?

* Is there any sane way to change a UID after a user has been created? I've tried modifying in netinfo, with generally incomplete results...

* Can the normal BSD user/group utilities (if present) be used in conjunction with the OSX tools?

I'd like to be able to share our NFS resources properly on the Mac so the UIDs must match. I'd rather shoehorn the Mac in than modify our current settings on the network.

Thanks - any help (especially with the 1st quest.) appreciated!

JB
 
Originally posted by johnnyb
Hello All

Couple quick questions:

* Is there any way to specify a numeric UID and/org GID at user creation time?

In OSX Server: yes, in client: no.


* Is there any sane way to change a UID after a user has been created? I've tried modifying in netinfo, with generally incomplete results...

You had the right idea. Change it in netinfo manager. The one caveat is that you then have to go and chown the home directory, becuase it will still be owned by the old UID. (make sure to use chown -R). I've done this many times on the systems I manage, I'm not sure why it would be "incomplete"...


* Can the normal BSD user/group utilities (if present) be used in conjunction with the OSX tools?

Sort of. You can edit the normal BSD /etc files, but then you have to run niload to suck the info into the netinfo db.
man niload
man niload
man niload...
(Aslo, for completeness, "man nidump" which goes in the other direction)
So if you aquired or wrote an add_user script that editied /etc/passwd, it would be possible to transfer those changes into netinfo.

I'd like to be able to share our NFS resources properly on the Mac so the UIDs must match. I'd rather shoehorn the Mac in than modify our current settings on the network.

What OS is serving NFS? Some systems will let you remap users on the server side (with a directive /etc/exports like map_all=joe_user). That may not be what you want, but I thought I'd mention it. Have you looked as using NIS? I haven't actually tried it, but OSX can supposedly act as a yp-client. That would give you a central point of administration without having to manually edit your UIDs. If you want to give yourself even more to do, you could run an LDAP server on your NFS server and pick up the user info that way. (the difficulty of that project on various UNICES varies from pain-in-the-ass to downright impossible).

Hope this helps....

-alex.
 
Originally posted by alexrd

<snip>
* Is there any sane way to change a UID after a user has been created? I've tried modifying in netinfo, with generally incomplete results...

You had the right idea. Change it in netinfo manager. The one caveat is that you then have to go and chown the home directory, becuase it will still be owned by the old UID. (make sure to use chown -R). I've done this many times on the systems I manage, I'm not sure why it would be "incomplete"...

It was 'incomplete' because I chose not to chown -R the directories. I wasn't sure if I should treat it like a Unix box of if there existed an 'OSX' way to do it.


* Can the normal BSD user/group utilities (if present) be used in conjunction with the OSX tools?


Sort of. You can edit the normal BSD /etc files, but then you have to run niload to suck the info into the netinfo db.
man niload
man niload
man niload...
(Aslo, for completeness, "man nidump" which goes in the other direction)
So if you aquired or wrote an add_user script that editied /etc/passwd, it would be possible to transfer those changes into netinfo.

I'll read the man page for both. Sounds enlightening (didn't know they existed)..

<snip>


What OS is serving NFS? Some systems will let you remap users on the server side (with a directive /etc/exports like map_all=joe_user). That may not be what you want, but I thought I'd mention it. Have you looked as using NIS? I haven't actually tried it, but OSX can supposedly act as a yp-client. That would give you a central point of administration without having to manually edit your UIDs. If you want to give yourself even more to do, you could run an LDAP server on your NFS server and pick up the user info that way. (the difficulty of that project on various UNICES varies from pain-in-the-ass to downright impossible).

Hope this helps....

-alex.

The NFS serving opsys is linux and occassionally FreeBSD. I moved from AFS to NFS last year for simplicity's sake. (AFS is a lot of work for 5 boxes ;-) I've been meaning to check out LDAP, I may look into it. For now it's been less of a headache to just admin the clients since there are really on 4 accounts to handle.

Thanks for the info - I'll make the mods in netinfo, chown the proper directories and then check out the 'ni*' tools to see what they do.

Thanks - JB
 
Back
Top