Skip to content

Instantly share code, notes, and snippets.

@NovapaX
NovapaX / create group and user for web app.text
Last active January 1, 2018 08:10
Files needed to run a rails app in Mac OS X server. (and be able to control it in server.app) I might write a blog post someday. I generate all these files with some capistrano 'wizard'-style tasks. This is tested for an app running under the root (/) of a virtualhost. Running under a subdirectory should work, but needs some more testing. Server…
sudo dscl . create "/Groups/org.example.webapp.appname"
# find a free group id and use it. (something in the 300 range will hide it from normal user management)
sudo dscl . create "/Groups/org.example.webapp.appname" PrimaryGroupID 303
sudo dscl . create "/Groups/org.example.webapp.appname" RealName org.example.webapp.appname
sudo dscl . create "/Users/org.example.webapp.appname"
# find a free userid
sudo dscl . create "/Users/org.example.webapp.appname" UniqueID 303
# use the groupid of the group you just created
sudo dscl . create "/Users/org.example.webapp.appname" PrimaryGroupID 303