Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dedicated server from a friendly host located a substantial distance away from me, so the only access to the machine is SSH. It's a month to month deal, so I don't own the hardware. I'm migrating everything to a new server, and I was thinking that it would be possible for the next tenant to get creative with data recovery utilities and recover my data that was previously stored on the same hard drive. What commands, if any, should I run on a dedicated server to "back out" of the server with a reasonable attempt at protecting any data that was on it? The server is your typical LAMP variety.

share|improve this question
Related: unix.stackexchange.com/questions/12304/… – Mat Jan 8 '12 at 9:14

The last command you could run when youre completely done with the box is dd if=/dev/zero of=/dev/sdX bs=1M (with sdX being your root drive). This will completely wipe the entire drive. It is important that this be the last command you run, as when the command completes, you will have a very unhappy box, and nothing will run.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.