16

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?

1
  • 2
    I would seriously consider making a new admin account so you can erase free space and really clean things. The system is designed to prevent non-admin users from deleting some personal data and even admin users have to jump through hoops to delete the default folders. You don't have to hack their account - just get yourself another admin account and password and leave a shell user once you've shredded / deleted your personal traces.
    – bmike
    Commented May 17, 2011 at 14:01

3 Answers 3

22

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.

2

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.

2
  • with the machine belonging to the employer, not him, i wouldn't recommend this.
    – user6124
    Commented May 17, 2011 at 14:21
  • Good point calling out ownership - Without knowing what agreements are in place it's folly to recommend anything (of which I'm clearly guilty) - ignoring policy can get you fired and deleting company data could land you in court but ownership of user data is less clear even when there is no expectation of privacy on a work computer.
    – bmike
    Commented May 17, 2011 at 15:16
0

Since you do not have any administrator privileges, I would recommend a complete wipe-out of your home folder. Since you own your home folder and all of its contents, do this command in terminal:

rm -rf ~/*

This way all your data will be gone.

1
  • 2
    Non-admin users don't actually own their home folders and many files/folders with personal data in them. This won't delete safari history, syncing history, and other data a typical user would expect to clean. Also - srm might be better to shred the data since without an admin password the user can't securely erase disk space after the fact. Probably overkill, but useful to mention just in case.
    – bmike
    Commented May 17, 2011 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .