The Geeky Way to Remove Users in OS X

If you’re thinking about getting rid of or selling your older (OS X) computer but you can’t seem to find those restore disks that came with the computer, have no fear! You can still delete your user account so the recipient of your old computer won’t have access to your old files.

Please note that I’ve only tested this under OS X 10.3 and 10.4 machines. I know it doesn’t work on OS9 so don’t bother! I recommend that you be some-what familiar with the command line and know how OS X works to make the most of this tutorial.

Of course you should back up any information that you want and be aware that we’ll be using the command line interface to get this task done. After you’ve backed up all your files, restart your computer. Hold down Apple+S. This starts the computer up in single user mode. It’s quite archaic looking, no pretty windows, just a terminal that you have to type commands into. So let’s start with this command:

mount -uw /

This will mount the hard drive in a mode that allows us to write and modify it. This is good because we’re wanting to remove your user account from it.

Next type in:

cd /var/db/

This will move us into the /var/db/ directory. When you’re normally in OS X you would never see this directory because it’s hidden, mostly to protect you from deleting important files!

So now that we’re in /var/db/ let’s type:

ls -la

This will list the contents of that directory. You should see a file in there called .AppleSetupDone. We want to remove that file and the command to do that is:

rm .AppleSetupDone

Make sure you type that as .AppleSetupDone and not .applesetupdone or any variant thereof because that’s quite different and it won’t work! That command will remove that file from the system. The .AppleSetupDone file is created when you initially setup the system. If that file ISN’T there that intro movie and initial setup of the computer will be shown upon startup of the computer.

Next type in:

rm -R netinfo/

This command is a lot like the previous in that it deletes. The -R means it’s going to recursively delete which is what we need since netinfo/ is a directory. Had it just been a normal file (MP3, Word document) we could have dropped the -R part. The netinfo/ directory contains your account information and other information about system accounts on your computer.

Next we’re going to get rid of all your user accounts files. It’s important that you understand that once you run this command, all data under your user account is gone so be careful!

Type in:

cd /Users/

This will put you in the Users folder where all the user account data is kept, these are your documents, movies, music, etc…

Type:

ls -la

This again lists the contents of the folder. Hopefully you see your username in there. If so, type:

rm -R “your username”

example: rm -R jimmy/

This will delete the entire user account, files, folders, everything you kept in your home folder.

So now to test and make sure everything worked, type in:

shutdown -r now

This command will reboot your computer. If all worked well you’ll get that movie you first saw when you turned on your computer and you’ll get prompted to create new user accounts, set the date and time, etc…

You should note also this process will only remove your user account and data stored in your home folder. If you’re a messy person and keep files in the root of your hard drive or other places then you’ll have to go delete those too. This process also doesn’t remove applications you’ve installed such as Photoshop, games, Microsoft Office. You can remove those sorts of applications either using the command line or by logging into OS X normally and deleting them (drag to trash and empty).

Similar Posts

  • Display Your .Mac Bandwidth Usage

    Uploaded with Skitch! If you host a podcast or have a large photo gallery, keeping an eye on how much bandwidth you use…

  • De-authorize your iTunes Account Before Hardware Repair or Sale

    Pretty much everyone has downloaded media from the iTunes store, but not too many of us know just how iTunes keeps track of computer authorization. Every device on the internet has at least two unique identifiers: a MAC address and an IP address.

    MAC is an acronym for Media Access Control. Many believe that Mac, the abbreviation for Macintosh, should be written with capital letters – this is incorrect. Likewise, iPod – not iPOD or IPOD; iMac – not iMAC or IMAC; etc. Network interfaces have MAC addresses; Macintoshes can be called Macs.

    Since your MAC address is completely unique, it’s the ideal way for iTunes to know that you’re authorized to play purchased content on any given machines. Trouble is, your ethernet port is part of the main logic board, which requires replacement in some repairs. With a new main logic board comes a new MAC address, which confuses iTunes and some other, generally high-end, software.

    You’re allowed to authorize up to five computers at any one time to play your purchased content, but replacing your logic board changes the MAC address. If you didn’t de-authorize before repair, you’ve lost 20% of your available authorizations. I made this mistake a few years ago when I had to replace the logic board in a Mac Mini hooked up to my television, and when I sold my iBook. I also lost an authorization when my two-week-old PowerBook G4 flew off the roof of my car at highway speed. Thankfully, iTunes allows you to de-authorize all computers on your account once annually.

    I only have one Machine these days, a 17-inch MacBook Pro, so this hasn’t been a problem of late for me. It’s a common question asked our technical support team, and a good fix to file in your troubleshooting arsenal.

    The full details from Apple can be found here: http://support.apple.com/kb/HT1420

  • HOW-TO: Type Accents on Your iDevice

    During my free time, I often use my iPhone to practice my foreign language skills. Well, not really, but a girl can dream….