Submitted by tlarkin on Thu, 11/20/2008 - 16:08
Here is a simple script to create a local user account, this script is designed with the idea of it being in an educational environment, so if you decide to use make sure to tweak it to your needs. I have tested it in mass in OS X 10.5.3 and 10.5.5 (several thousand clients) and it works great.
Here it is!
Now, if you wish to use varibales to create several local user accounts remove the pounds fromthe variables and alter the script accordingly. This is a standard local user account, you may also want to write in variables for the UniqueID (UID) for the users as well if you are going to create multiple. Anything over UID 500 is reserved for local user accounts and anything over 1000 is reserved for Directory (network) accounts. You can alter this script accordingly to match your needs, but if you are going to create massive Directory Accounts I recommend a third party Application to import them called Passenger.
#!/bin/bash #you can fill in the blanks below and remove the pounds for varibale usage or manually input the data LongName="Student" ShortName="student" Password="password" dscl . -create /Users/"$ShortName" dscl . -create /Users/student UserShell /bin/bash dscl . -create /Users/student RealName "$LongName" dscl . -create /Users/student UniqueID 505 dscl . -create /Users/student PrimaryGroupID 20 dscl . -create /Users/student NFSHomeDirectory /Local/Users/student dscl . -passwd /Users/student "$password" dscl . -create /Users/student dsAttrTypeNative:_writers_hint: Typical password dscl . -create /Users/student dsAttrTypeNative:_writers_LinkedIdentity: student dscl . -create /Users/student dsAttrTypeNative:_writers_passwd: password dscl . -create /Users/student dsAttrTypeNative:_writers_realname: student dscl . -create /Users/student dsAttrTypeNative:_writers_UserCertificate: student exit 0
- Login to post comments
