MacOS – Removing personal data from OSX without deleting user or reinstalling OS

deletingmacos

I will be returning my work machine to my employer soon and I would like to leave little or no personal trace on the machine.

I am not able to create a new user, delete my user, access the administration account, or reinstall the OS, but otherwise I do have full administration rights to my user name.

What options do I have for removing as much personal data as possible?

Best Answer

I would remove all files from the the obvious:

  • Desktop
  • Downloads
  • Movies
  • Music
  • Pictures
  • Public
  • Sites

Then inside your Library Folder you could send everything inside the following folders to the trash:

  • Application Support (this will remove all settings and data from any application you used)
  • Autosave Information
  • Caches
  • Calendars
  • Cookies
  • Favourites
  • Fonts
  • Google
  • Images (iChat stores images here)
  • Keychains (all your passwords that are encrypted into your keychain)
  • Logs
  • Mail (all your email)
  • Mail Downloads (all your attachments from mail)
  • Preferences
  • Preference Panes
  • PubSub
  • Safari

Once you've sent all relevant files to the trash. Secure Empty Trash from the Finder menu.

Finally, you can over-write any left-over file data on the hard drive by doing the following:

  1. Create a large file that takes up all remaining disk space. Let's say that it's called '~/bigfile'. You can do the following using the Terminal.app or X11.app to consume all remaining free space on your hard drive: yes "Foo Bar Baz" > ~/bigfile

  2. Secure-erase the file: srm -m ~/bigfile

This in effect simulates the Disk Utility's "Erase Free Space" feature without needing admin access. More on this method can be found here.

Finally, you might want to cover your tracks a bit by deleting your shell history. Assuming that you are using the default Bash shell, you can delete your ~/.bash_history file.