We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Remotely wipe a Linux server

Medium Priority
1,165 Views
Last Modified: 2013-12-15
I have a Linux redhat server in a datacenter that I lease, we're switching companies and as part of the migration I want to securely wipe the old server's hard drive once we're done moving it. What command or program or shell script would I use to do this? I'm thinking use some kind of secure delete app first to clean the server up as much as possible then have something delete the entire partions and drive space or reformat at startup etc?
Comment
Watch Question

Commented:
So you do not have physical access to the server? I can't think of a way since to securely wipe it you will need some sort of local boot disk that can clear the partitions and wipe the data including the operating system. You will lose you access to the machine once the partitions have been deleted.

Author

Commented:
Right, I know that you normally use a book disk, that's why I'm asking is there something you can load from the hard drive that will run at next restart and wipe itself? I mean once it's loaded from the hard drive into memory then it can just delete the hard drive right? Maybe load something into the MBR a loader that wipes the drive etc?

Commented:
Thanks for asking the question. This will be interesting. I will have to mark this one as monitored to see if anyone has a solution for this. Sorry I don't have a suggestion for you at this time.

Commented:
Does the datacenter that is hosting the server have an IP based KVM switch that you can connect to from a remote location? If so you could ship a boot CD with the tools needed for wiping the drive. Just ask them to place the cd into the tray for you. After that you would be able to force a reboot and use the KVM as though you were physically at the computer in order to wipe it out.

Author

Commented:
No KVM, and probably wouldn't allow a CD to put in the server for security reasons.

Commented:
I am guessing you are in the US from your time zone, but this type of activity may be frowned upon here in the UK. It could potentially be viewed as an offence under the Computer Misuse Act as you don't own the hardware.

I would guess it depends on whether this is a dedicated server with no other data on it, or whether you are on a shared server containing other user's data. If it is a shared server I'm sure there would be some objections!

Is this eventuality covered under the agreement you have with the data centre? Is data destruction offered as part of the service you have? Or is it an additional service you could request from the operators of the data centre? I'm guessing this is not an option since you're asking the question, but thought I'd mention it just in case.

I'd be interested to see what solution comes up, I would have thought it was possible but it may leave you in a vulnerable position if the operators of the data centre took offence at that activity.
Unfortunately I'm unable to offer a better option than having the conversation with the operators of the data centre.

Author

Commented:
Of course I can delete our data, it's our server and our data, we are doing it for security reasons as I dont' want our old hard drive just floating around with private data on it. And it's too important to trust the datacenter up to doing it right. It's not something I want to hope that it's done properly, but I may have no choice but to request that they wipe the server. They say that they do that anyway, but I bet they just reimage it, but I think reimaging isn't seucre.
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Backups I know for sure expire on a rotational basis, they're stored in a robotic IBM SAN system, so I know that the old backups will expire and be deleted in a couple weeks.

I could request the Hard drive, but I did that before with a datacenter when a server crashed and the backups had a problem for some files. What they did shocked me, I told them I needed it ASAP. They said we'll try to ship it today, then they got back to me a bit later and said my hard drive is packed and sitting by the back door of the data center waiting for Fedex to pick up! Jesus... So my hard drive was just sitting there outside the data center in a box waiting for some skateboarder or something to roll up and ride off wtih it !? lol unbeliable, that datacenter is no longer in business by the way. Ever heard about the Valueweb/Affinity/Hostway outage/migration nightmare they did, well that was them, and when I heard they got bought out and want to migrate my servers, I was out of there fast to a new datacenter and it was a good thing too as old servers where down for over a week! I would have lost all my customers I'm sure.
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
i would use a variation of the method used to change a linux distro on virtual servers. Basically, it involved somehow using chroot to create a small linux install in an unmounted, prewiped swap partition, and then passing control over to it - and unmounting all the other partitions, and using the tools in the chroot wipe the partitions, all that would be left on the server, would be your small chroot jail that had the wipe command in it.

i know i'm paraphrasing up there, but it may jog the memories of some who have done it in the past.
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Commented:
Nice solution AngelGabriel. That is a clever way to reinstall the OS.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.