Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Our hosting company has setup a "hardened template" of Ubuntu Server 12.04 to be used as a web server. Which I have interpreted as a base install with a bunch of additional tweaks including firewall settings and installing the basics like SSH/PHP/mySQL.

Is there a way to view/download the exact commands/tweaks done to get the server to it's current state. I am asking this, so if I do "stuff up" anything I can revert to a fresh "hardened template" version.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I imagine there are two things you could do. Option A (easier) would be to just make an image of the drive when you first get it and restore from that whenever needed. Option B (harder) would be to diff every file against their originals. "Every file" should be read as the output of dpkg -l and likely everything under /var and /etc.

The only record of what is done to a machine would be what is in your shell history (which they likely didn't leave around for you) and in the logs of utilities like dpkg and apt which can likely be regenerated easier by using dpkg -l than by parsing the logs.

Side note: I guess option C would be to ask your provider what they did.

share|improve this answer
    
Option C is yes an option :) In terms of Option A, is there a quick link to making an image, if not I will starting researching –  Chris Oct 17 '12 at 1:00
    
I guess that depends on the type of image you want to do. The easiest solution would be to use dd, which will make a byte-for-byte copy of the partition (that includes non-used space). With compression you'll use something like dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > /mnt/backup/sda.img.gz –  Huckle Oct 18 '12 at 3:25
    
The downsides being that it is slow and the output before compression is large. Another option would be to use a tool like rsync however I'm not really certain how well it deals with hardlinks and symlinks so I don't generally use it for OS files. –  Huckle Oct 18 '12 at 3:27
add comment

Your Answer

 
discard

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.