100

To find the GUID of the administrator user:

>cd /Users/

>read adminusername GeneratedUID

Checking a User’s Administrator Privileges

Use the serversetup tool to verify the administrator privileges of a specific user.

To see if a user is a server administrator:

$ sudo /System/Library/ServerSetup/serversetup -isAdministrator shortname

The command displays a 0 if the user is an administrator, or a 1 if the user is not an administrator.

Creating a Nonadministrator User Account

You can create new user accounts by using dscl and other tools. When you create a user account from the command line, you must also set values for basic attributes of the user account, such as the short name, long name, user ID, and home folder location.

To create a nonadministrator user account:

1Identify an unused user ID. Each user on a server must have a unique user ID. Use the dscl tool to display lists of assigned user IDs and group IDs.

$ dscl /LDAPv3/ipaddress -list /Users UniqueID awk '{print $2}' sort -n

Replace /LDAPv3/ipaddress with the location of your directory domain (the way it is displayed in the search path in Directory Access). If you connect to a NetInfo domain, replace UniqueID with uid.

After you enter the command, the dscl tool displays a list of assigned user ID numbers, similar to the following output. These user IDs are for computer accounts that are included with Mac OS X Server:

-2 0 1 99 25 26 27 70 71 75 76 77 78 79 501

Chapter 8 Working with Users and Groups

Page 100
Image 100
Apple Mac OS X Server manual Checking a User’s Administrator Privileges, Creating a Nonadministrator User Account