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.
Asked
Active
Viewed 7.2k times
3 Answers
23
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:
5
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>
GeorgeAsante
- 51
1
You might want to check out the third Google hit for "mac useradd equivalent 10.5"...
Brennon Bortz
- 201