Securely deleting files from terminal in Mac OS X

In the Mac OS X GUI, Under the Finder Menu go to Preferences [Command ,] then go to the Advanced Tab and select Empty Trash Securely. Now there is a trick to this as I discovered if you just click on the trash can and request to empty files it will do a standard deletion nothing secure about it!

There are two ways to delete the files securely.

1. Open the Trash Can in the top Right of the Trash it have a button Empty Securely click it and it will empty the trash using srm from the gui, however it will not use a DoD secure delete profile by default.

Note: The -s option overrides the -m option, if both are present. If neither is specified, the 35-pass Gutmann algorithm is used.

2. From MacOSXHints;

What if you want to remove a file but not use the Trash? The new feature was introduced in Panther & is the command/usr/bin/srm. There are two other options that secure empty trash doesn’t use:

-m, –medium
overwrite the file with 7 US DoD compliant passes (0xF6, 0x00,
0xFF, random, 0x00, 0xFF, random)

-z, –zero
after overwriting, zero blocks used by file

So, srm -mz [filename] will do a DoD compliant erase and zero the data.

Hope this helps!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s