Create Administrator account in Single-Mode
- Using ⌘+S to boot into Signle-Mode
- Execute following command
- Reboot or Type `exit` to boot into login window
Command:
/sbin/fsck -fy
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
dscl . -create /Users/hiddenuser
dscl . -create /Users/hiddenuser UserShell /bin/bash
dscl . -create /Users/hiddenuser RealName "Hidden User"
dscl . -create /Users/hiddenuser UniqueID "401"
dscl . -create /Users/hiddenuser PrimaryGroupID 20
dscl . -create /Users/hiddenuser NFSHomeDirectory /var/hiddenuser
dscl . -passwd /Users/hiddenuser password
dscl . append /Groups/admin GroupMembership hiddenuser
ref2: https://managingosx.wordpress.com/2006/09/15/add-a-user-to-the-admin-group-via-command-line-20/
留言
張貼留言