How do I manage user & groups?

Sunnz

Who wants a stylus?
Ok so I need to create a new group and add an existing user (myself) to this group.

This is how I usually do it on a nix box:
groupadd -g 8080 mygroup
usermod -G mygroup myuser

But I can't find these commands on OS X...

I tried looking at System Preference but can't find anything like this, how do I manage users & groups on OS X?
 
Well I don't know, it feels like regedit on M$, but got that nix touch in it....
 
remember that the directory services store all user and group information. The traditional /etc/group etc are only used in single user mode.

so, you can use the dscl command to create and update groups from the command line (into the directory). such as:

dscl . create /groups/sunnz gid 1000
dscl . create /groups/sunnz passwd '*'
dscl . merge /groups/sunnz users user1 user2

above creates a group 'sunnz' with gid 1000 and adds user1 and user2 to it.

you can check your work in the netinfo manager with:

nidump group . | grep sunnz

Netinfo might be more straightforward! ;)
 
Yea Netinfo seems to be a bit easier...

I mean, what's dscl? Kind of counter-intuitive compared to groupadd and stuff.
 
object oriented mumbo jumbo! dscl is a generic interface for managing the data in the repository. I've used AIX, with it's odm, so I'm kinda used to it. but I use netinfo for this stuff...onry if I was automating a bunch of stuff would I use dscl. onesy twosey is too easy though gui.
 
Back
Top