Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ferko86

macrumors member
Original poster
Feb 22, 2017
34
6
Sweden
When i create a local admin user on OSX , i get everything OK , BUT i cant make any changes on the System Preferences , cant change TrackPad settings , cant change NADA .
It looks good when i check the users permissions .

the user that got this problem have the name "userbad" .
when I look at /Users/userbad/Library/Preferences there is nothing but only one file (.plist)

when i look at "usergood"
/Users/usergood/Library/Preferences there are tons of .plist files .
inside usergood account I can adjust/change as normally inside the systempreferences icon.

I assume that it have to do with some inheritance-issue while creating the new account , or am I wrong ?

Anybody that can figure it out ?

The commands i used when creating the username :

Code:
dscl . create /Users/userbad
dscl . create /Users/userbad RealName "userbad1"
dscl . passwd /Users/userbad kotte
dscl . create /Users/userbad UniqueID "590"
dscl . create /Users/userbad PrimaryGroupID 20
sudo cp -R /System/Library/User\ Template/English.lproj /Users/userbad
dscl . create /Users/userbad UserShell /bin/bash
chown -R userbad:staff /Users/userbad
sudo dseditgroup -o edit -a userbad -t user admin
sudo dseditgroup -o edit -a userbad -t user wheel
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
You haven’t assigned the user directory.
Code:
NFSHomeDirectory: /Users/userbad

Don’t add the user to the wheel group. On macOS, that group is reserved for root. You should also add it to the ‘staff’ group.
 

ferko86

macrumors member
Original poster
Feb 22, 2017
34
6
Sweden
You haven’t assigned the user directory.
Code:
NFSHomeDirectory: /Users/userbad

Don’t add the user to the wheel group. On macOS, that group is reserved for root. You should also add it to the ‘staff’ group.

Hi KALLT , thanks for the reply .

I cant get this script working when working with variables . But i i will try it .
I'll come back tp you owith results.
 

ferko86

macrumors member
Original poster
Feb 22, 2017
34
6
Sweden
Hi KALLT ,

this is the scrip im trying to use ,
Code:
#!/bin/sh
USERNAME=name1
FULLNAME=name1namn
PASSWORD=”name1123”
GROUPS=”staff”

# Find out the next available user ID
MAXID=$(dscldscl . -list /Users UniqueID | awk '{print $2}' | sort -ug | tail -1)
USERID=$((MAXID+1))
echo ”$USERID”


# Create the user account
dscl . -create /Users/$USERNAME
dscl . -create /Users/$USERNAME UserShell /bin/bash
dscl . -create /Users/$USERNAME RealName "$FULLNAME"
dscl . -passwd /Users/$USERNAME $PASSWORD
dscl . -create /Users/$USERNAME UniqueID "$USERID"
dscl . -create /Users/$USERNAME PrimaryGroupID 20
dscl . -create /Users/$USERNAME NFSHomeDirectory /Local/Users/$USERNAME
sudo dseditgroup -o edit -a $USERNAME -t user admin

# Create User HomeFolder using OS X’s own template
sudo cp -R /System/Library/User\ Template/English.lproj /Users/$USERNAME

# Change owner of the home folder to our new user
chown -R $USERNAME:staff /Users/$USERNAME

# Set permissions so that only our user(the owner) can access the folder
chmod -R 600 /Users/$USERNAME

# Output message
echo "Created user #$USERID: $USERNAME ($FULLNAME)"
printf ”dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5’[0-9][0-9]’”

#Output results to a file
system_profiler >> /Users/name1/Desktop/report.txt
whenever i Run the script , the new user account's full name appear as blank in the login user list.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.