Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to add unix groupadd command on Mac OSX 10.5? I'm trying to do man on groupadd and useradd commands but it doesn't seem to exist.

share|improve this question

migrated from stackoverflow.com Aug 9 '11 at 0:07

This question came from our site for professional and enthusiast programmers.

groupadd and useradd are Linux-isms.

For some good answers on how to add users from the command line in Mac OS X, see this question on ServerFault:

http://serverfault.com/questions/20702/how-do-i-create-user-accounts-from-the-terminal-in-mac-os-x-10-5

share|improve this answer
    
Please, no link only answers. – Masi Jul 2 '15 at 20:06
    
@Masi It's not a link-only answer. OP didn't ask how to add groups from the command line, he asked how to add the groupadd tool itself to OS X, because he mistakenly thought groupadd was something fairly Unix-standard. The answer was, bluntly, "you don't". The link was an attempt to predict and pre-answer something he hadn't yet asked. – Spiff Jul 2 '15 at 20:44

You might want to check out the third Google hit for "mac useradd equivalent 10.5"...

share|improve this answer
    
as of now, this page IS the third google hit.. – andy Mar 26 '15 at 22:06
    
That's fun... ;) – Brennon Bortz Apr 22 '15 at 14:56

Like mentioned before, useradd (and adduser) are Linux commands.

Lucky for you there is the OS X dscl command. I've written a simple script for adduser and deluser that you can find at the following links. The key piece of the linked adduser script is below.

https://github.com/GeorgeKA/MiscWork/blob/master/adduser-osx https://github.com/GeorgeKA/MiscWork/blob/master/deluser-osx

sudo dscl . -create /Users/<user>
sudo dscl . -create /Users/<user> UserShell /bin/bash
sudo dscl . -create /Users/<user> RealName "<realName>"
sudo dscl . -create /Users/<user> UniqueID "<userID>"
sudo dscl . -create /Users/<user> PrimaryGroupID <groupID>
sudo dscl . -create /Users/<user> NFSHomeDirectory /Users/<user>
sudo dscl . -passwd /Users/<user> <passwd>
sudo dscl . -append /Groups/admin GroupMembership <user>
share|improve this answer
1  
@JesseSielaff, appreciate the heads up. Fixed the links – GeorgeAsante Mar 3 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .