Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
docs:mac:add_user [2007/12/07 21:44] – created billh | docs:mac:add_user [2008/08/03 00:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== add user ====== | ====== add user ====== | ||
**Netinfo utility has been removed from Mac OS X 10.5 (Leopard). | **Netinfo utility has been removed from Mac OS X 10.5 (Leopard). | ||
+ | |||
===== dscl ===== | ===== dscl ===== | ||
- | FIXME | + | Mac OS X 10.5 does not have the useradd or adduser commands, since user management is handled by Directory Services. You can instead create a user account with the dscl command from the Terminal application. You will need sudo or root access to create the user account. |
+ | |||
+ | Although the manual does not mention groups, it is a good idea to give the user account its own group as well. This prevents any files in the database cluster with group write-access from being modified by other users. | ||
+ | |||
+ | To create the user account and group from the Terminal application, | ||
+ | |||
+ | < | ||
+ | $ sudo dscl . -list /Groups PrimaryGroupID | ||
+ | $ sudo dscl . -list /Users UniqueID | ||
+ | </ | ||
+ | |||
+ | or if it helps you to see just a sorted list of IDs, type | ||
+ | |||
+ | < | ||
+ | $ sudo dscl . -list /Groups PrimaryGroupID | cut -c 32-34 | sort | ||
+ | $ sudo dscl . -list /Users UniqueID | cut -c 20-22 | sort | ||
+ | </ | ||
+ | |||
+ | Assume that group ID 50 and user ID 100 are not in use. First create the group _postgres by typing | ||
+ | |||
+ | < | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -append / | ||
+ | </ | ||
+ | |||
+ | (Leopard precedes daemon names with an underscore. The last command created an alias without the underscore, though, so that you can forget the underscore exists.) | ||
+ | |||
+ | Then create the user account _postgres by typing | ||
+ | |||
+ | < | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -create / | ||
+ | $ sudo dscl . -append / | ||
+ | </ | ||
+ | |||
+ | The user account is now created. It is not given a password intentionally. This prevents anyone but root from logging in as postgres. To use the postgres user account, type | ||
+ | |||
+ | < | ||
+ | $ sudo su - postgres | ||
+ | </ | ||
+ | |||
+ | When the database cluster is initialised, | ||
+ | |||
+ | < | ||
+ | root# chown postgres: | ||
+ | </ | ||
===== External Links ===== | ===== External Links ===== | ||
+ | * http:// | ||
+ | * http:// | ||
* (pre-Leopard) | * (pre-Leopard) | ||
* http:// | * http:// |