Removing personal data from OSX without deleting user or reinstalling OS
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
- 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:
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
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.
The best way to securely delete your data is to get around the protections that are built in to prevent new users from accidentally deleting things needed to make the system run.
You can always take it to a local tech shop or Apple Store and get a fresh install or have them reset the admin password. Trained techs with access and permission from you can usually have you a new admin account in less than 10 minutes. This service might be free or very reasonable since the effort needed is low and all shops will have the tools and training for a quick job.
You can get around not having an admin account yourself in many ways:
- Booting the mac in target mode and connecting it with another mac
- booting in single user mode - here's how to erase a user totally
- removing the drive (MacPro or some portables is very easy)
If you delete the file /private/var/db/.AppleSetupDone
the setup assistant runs and you can make yourself a new admin user. You can always use that to make another shell account with the same short name once you have deleted the data you want cleared. You can even demote this user to a non-admin account and shut down the mac leaving it empty and clean but not suspiciously wiped.
If for social reasons you don't really want to erase everything (or you don't want to accidentally delete something you want to return to the company) you will have to spend more time to separate things and can use the terminal to delete MOST of your files. I like to make a new user and explicitly move and organize everything I feel compelled to hand back to the company in return for the salary they paid me. If the acceptable use policy allows you to use company property for personal use, there shouldn't be an issue with you cleaning up and securing your personal data before relinquishing company property and data.
Back to technical details, you won't be able to delete the folders in your home folder and some data (like safari history and data that was synchronized) is protected from deleting. I'll show at the end how to see those files and you can then use Safari to reset browsing, or choose to let that data go back with the mac.
The four commands used are ls (which shows a file listing), srm (does the shredding and then deletes the files), wc (used to count all the files), pwd (used to show your home folder short name - doesn't do anything else). I named my mac me and the user's short name is short. Your mac will likely be different and your file counts should be higher since this was a test account without much data.
Last login: Tue May 17 08:29:31 on console mac:~ short$ ls -laR|wc -l 1339 mac:~ short$ pwd /Users/short mac:~ short$ srm -rf * srm: Desktop: Permission denied srm: Documents: Permission denied srm: Downloads: Permission denied srm: Library/Application Support: Permission denied srm: Library/Assistants: Permission denied srm: Library/Audio/MIDI Drivers: Permission denied srm: Library/Audio/Plug-Ins/Components: Permission denied srm: Library/Audio/Plug-Ins/Digidesign: Permission denied srm: Library/Audio/Plug-Ins/VST: Permission denied srm: Library/Audio/Plug-Ins: Permission denied srm: Library/Audio/Sounds/Alerts: Permission denied srm: Library/Audio/Sounds/Banks: Permission denied srm: Library/Audio/Sounds: Permission denied srm: Library/Audio: Permission denied srm: Library/ColorPickers: Permission denied srm: Library/Compositions: Permission denied srm: Library/Favorites: Permission denied srm: Library/FontCollections: Permission denied srm: Library/Fonts: Permission denied srm: Library/iMovie/Plug-ins: Permission denied srm: Library/iMovie/Sound Effects: Permission denied srm: Library/iMovie: Permission denied srm: Library/Input Methods: Permission denied srm: Library/Internet Plug-Ins: Permission denied srm: Library/Keyboard Layouts: Permission denied srm: Library/Logs: Permission denied srm: Library/PreferencePanes: Permission denied srm: Library/Preferences: Permission denied srm: Library/Printers: Permission denied srm: Library/Screen Savers: Permission denied srm: Library/Sounds: Permission denied srm: Library/Voices: Permission denied srm: Library: Permission denied srm: Movies: Permission denied srm: Music: Permission denied srm: Pictures: Permission denied srm: Public: Permission denied srm: Sites: Permission denied mac:~ short$ ls -laR|wc -l 240 mac:~ short$
If you want to see all the 240 (or whatever) remaining files, just change ls -laR|wc -l
to ls -laR|more
and use the space bar to page through the listing of the files and folders that Mac is preventing you from deleting.