Help: Adding System Accounts
I am trying to roll a setup for a server that cannot use MacPorts. How do I go about adding users. I have played with the dscl command and have create users that do not show up under the System Preferences > Accounts but my group wont stick when I go to chown the home directory. Any ideas? Here are the commands I am using. sudo mkdir -p /usr/local/nagios sudo dscl . -create /Groups/nagios sudo dscl . -create /Groups/nagios UniqueID 9000 sudo dscl . -create /Users/nagios sudo dscl . -create /Users/nagios RealName "Nagios User" sudo dscl . -create /Users/nagios NFSHomeDirectory /usr/local/nagios sudo dscl . -create /Users/nagios UserShell /usr/bin/false sudo dscl . -create /Users/nagios UniqueID 9000 sudo dscl . -create /Users/nagios PrimaryGroupID 9000 passwd nagios sudo dscl . -create /Groups/nagcmd UniqueID 9001 sudo dscl . -append /Groups/nagcmd GroupMembership nagios sudo dscl . -append /Groups/nagcmd GroupMembership www sudo chown -R nagios:nagios /usr/local/nagios Thanks In Advance! -Ron
On Oct 21, 2007, at 6:43 PM, Ronald Valente wrote:
I am trying to roll a setup for a server that cannot use MacPorts. How do I go about adding users. I have played with the dscl command and have create users that do not show up under the System Preferences > Accounts but my group wont stick when I go to chown the home directory. Any ideas? Here are the commands I am using.
sudo mkdir -p /usr/local/nagios
sudo dscl . -create /Groups/nagios sudo dscl . -create /Groups/nagios UniqueID 9000
Groups don't have a "UniqueID" property in Darwin but rather "PrimaryGroupID", as revealed by "dscl . -read /Groups/ <some_existing_group_like_www>". I'm guessing chgrp(1) is looking for the value of "PrimaryGroupID" for the group you're passing it and failing when not finding it, so I'd try using it for your custom groups and see if things work like that. HTH! -jmpp
participants (2)
-
Juan Manuel Palacios
-
Ronald Valente