#!/bin/sh # # remove_user command # # Author: eK # World Wide Web: http://www.kelleycomputing.net # # this script is used to quickly remove a user account from a Mac OS X # based computer. This process will remove the current user's home # directory, the user account, and the '.AppleSetupDone' file. # change directories to the root of the drive to avoid error messages # this happens after we remove the cwd (/Users/$user). cd / # get the current user's shortname user=`whoami` # remove the user's home directory sudo rm -rf /Users/$user # remove the setup done file sudo rm /var/db/.AppleSetupDone # remove the user entry from the netinfo directory after other removals sudo nicl / -delete /users/$user # restart computer sudo reboot