Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Hidden" Users



There are users such as _mysql, _www. They seem to be aliased to mysql and www. They do not show up in the list of users you can "fast switch" between. They also do not show up in the list of accounts shows by System Preferences => Accounts.

I'm trying to create a postgres user. I've managed to do it with the script attached. But, I am not clear what the magic is that determines if it will be shown in these two places. I've managed, at one point, to create a user that did not show up in Accounts but did show up in the list of users you can fast switch between.

Does anyone know for sure what is used to determine the list of users displayed in Accounts and the list of users displayed in the fast user switching menu?

Thank you,
pedz

#!/bin/bash

# We loop to find a numeric value which is not a users uniqueid or a groups
# primary group id starting at 501
typeset -i uid=501
while [[ "$( dscl . search Users UniqueID $uid &&
dscl . search Groups PrimaryGroupID $uid )" ]] ; do
let ++uid
done


dscl . create /Users/postgres
dscl . create /Users/postgres UniqueID $uid
dscl . create /Users/postgres PrimaryGroupID $uid
dscl . create /Users/postgres NFSHomeDirectory /Users/postgres
dscl . create /Users/postgres Password '*'
dscl . create /Users/postgres UserShell /bin/bash
dscl . create /Users/postgres RealName 'Postgres Admin User'

dscl . create /Groups/postgres
dscl . create /Groups/postgres PrimaryGroupID $uid
dscl . create /Users/postgres RealName 'Postgres Admin Group'

if [[ ! -d /Users/postgres ]] ; then
	mkdir /Users/postgres
fi
chown -R postgres:postgres /Users/postgres

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.