Create Local Admin Account Issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
02-20-2017
10:47 AM
- last edited on
03-04-2025
04:58 AM
by
kh-richa_mig
I have AirWatch and I create an Admin Acount via ssh script. Everytime I log in with that account its a endless keychain pop-up need to repair the library. The also looks like it doesn't have rights to its own home folder. any thoughts?
```
!/bin/sh
Create Admin Account
dscl . -create /Users/administrator
dscl . -create /Users/administrator UserShell /bin/bash
dscl . -create /Users/administrator RealName "Administrator"
dscl . -create /Users/administrator UniqueID "510"
dscl . -create /Users/administrator PrimaryGroupID 1000
dscl . -create /Users/administrator NFSHomeDirectory /Users/administrator
dscl . -passwd /Users/administrator P@ssW0rd!
dscl . -append /Groups/admin GroupMembership administrator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-20-2017 12:03 PM
Try adding code to create a home directory.
#Create Home Directory
dscl . create /Users/admin NFSHomeDirectory /Users/admin
cp -R /System/Library/User Template/English.lproj/ /Users/admin/
chown -R admin:staff /Users/admin/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-20-2017 12:07 PM
Also, I typically would set the PrimaryGroupID to 20 to make the user part of the built-in staff group.
