[ubuntu-uk] Securely delete data

Tyler J. Wagner tyler at tolaris.com
Thu Nov 15 13:06:13 UTC 2012


On 2012-11-15 12:55, David Smith wrote:
> Supposing I have a netbook loaded with Xubuntu that I want to sell on (shameless plug, eBay item 290811097220).
> 
> If it was running a Microsoft OS, I'd create a new user, remove the old one, look around for and delete any data lurking in the root and find an app (CCleaner for example) that'd do me a couple of zero-fills.
> 
> Is it a good idea to create a new user and remove the old one to prep the Xubuntu netbook?  And is there a CLI or GUI app can I use to zero-fill?

Yes, it is a good idea. Instead of removing your existing user, you could
also clear out the home directory.

1. Logout of your user. Make sure the login greeter isn't going to
automatically log you in again.
2. Press Ctrl-Alt-F1 to switch to the first virtual console.
3. Login as root if you have set a root password. Otherwise login as your user.
4. rm -rf /home/username/*
5. rsync -av /etc/skel/ /home/username/
6. (if doing this as root) chown username:username -R /home/username

Then change the user's password.

Caveats:

1. Your old data is still on the drive, just deleted. Undelete is harder
with ext4 filesystems than FAT, but possible. See the "secure-delete"
package for how to remove it fully. Be aware that this can take 2-3 days of
run time to complete.

2. Formatting the drive isn't the same as secure delete.

3. The system will still have your packages installed, system logs, and
possibly wireless configurations (in /etc/NetworkManager).

To be super-paranoid secure, instead do this:

1. Boot on a Live CD/USB installer.
2. Open a terminal
3. sudo shred -v /dev/sda

Replace "sda" with your drive, but this is the default. This will overwrite
the entire drive contents repeatedly. It will take 2-3 days to complete 3
passes. You may consider one pass to be enough and cancel sooner.

4. Install the OS again using the Live CD.

Regards,
Tyler

-- 
"To have a child is to give fate a hostage."
   -- John F. Kennedy



More information about the ubuntu-uk mailing list