From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: [OSX/SYSADMIN] Example NFS setup for Rush on a small 'pure OSX'
   Date: Wed, 13 May 2009 20:37:16 -0400
Msg# 1839
View Complete Thread (1 article) | All Threads
Last Next
	Just a followup to this thread.

	When creating the 'render' user from the command line,
	Apple changed everything around in Leopard (10.5), so that now
	the 'niload' command is no longer available.

	They now recommend using their new 'dscl' command instead.

	So the Leopard version of the script to create the new 'render'
	user would be:

#!/bin/sh
#
# make-render-user - Run this script to create a 'render' user on Leopard/SnowLep/Lion..
# 1.0 05/10/06 - erco@(email surpressed) (original Tiger version)
# 1.1 05/13/09 - erco@(email surpressed) (changed for Leopard)
#
username=render          # user's name
     uid=555             # must be an unused uid
     gid=20              # 20=staff
  passwd=render          # the actual *cleartext* password for the user

# CREATE THE USER
dscl . -create /Users/$username
dscl . -create /Users/$username UserShell        /bin/bash
dscl . -create /Users/$username RealName         $username
dscl . -create /Users/$username UniqueID         $uid
dscl . -create /Users/$username PrimaryGroupID   $gid
dscl . -create /Users/$username NFSHomeDirectory /Users/$username
dscl . -passwd /Users/$username                  $passwd

# CREATE THE USER'S HOME DIRECTORY
cp -R '/System/Library/User Template/English.lproj' /Users/$username

# ENSURE OWNERSHIPS ASSIGNED TO USER'S ENTIRE HOME DIRECTORY
chown -R ${uid}:${gid} /Users/$username



	So that should be it.
	The older Tiger script is below for reference.

	BTW, if you want the new user to be an "administrator" user,
	you can add this line to the list of dscl commands:

		dscl . -append /Groups/admin GroupMembership $username


> STEPS TO SETUP
> --------------
> 
>          1) On all machines, create the "render" user with a fixed UID/GID that
>             doesn't conflict with any uid/gid on the network.
> 
>             This can be done easily by running the following script on each machine
>             as root to create the 'render' account on each machine with the uid=555,
>             gid=20, and the password set to 'render'. (Tested under OSX 10.4.x)
> 
> --- snip
> #!/bin/csh -f
> #
> # make-render-user - Run this script to create the 'render' user on a machine
> # 1.0 05/10/06 - erco@(email surpressed) - Supports Tiger (10.4), Panther (10.3)
> #
> set username = render                   # user's name
> set      uid = 555                      # must be an unused uid
> set      gid = 20                       # 20=staff
> set   passwd = 'oFxbR2cAnG902'          # passwd is 'render'
> 
> # CREATE PASSWD ENTRY
> echo ${username}:${passwd}:${uid}:${gid}::0:0:${username}:/Users/${username}:/bin/bash | niload passwd /
> 
> # CREATE USER'S HOME DIRECTORY
> if ( ! -d /Users/${username} ) then
>      cp -R '/System/Library/User Template/English.lproj' /Users/${username}
> endif
> 
> # ENSURE OWNERSHIPS ASSIGNED TO USER'S ENTIRE HOME DIRECTORY
> /usr/sbin/chown -R ${uid}:${gid} /Users/${username}
> --- snip

Last Next