0

I'm looking for a way for 1 server lcoated in Switzerland (acting as a web/db server) to share/sync files like deny.hosts and iptables rules to my other server (dns/mail) located in North America in a secure way.

Is that possible?

I hope that doing that will save time since I only have to update 1 server for the changes to spread.

Thanks for your help

1
  • 2
    There are quite a few ways to do this but the easiest is probably by using rsync.
    – blacklight
    Mar 12, 2014 at 6:42

2 Answers 2

2

I agree with blacklight in the comment above rsync is probably a good choice for this:

Rsync works like this:

$ rsync options source destination

so, if you want to use the "push" method, where you push the changes from Switzerland to USA, then you could run something like this:

$ rsync -avz /etc/deny.hosts myuser@<your host>:/etc/

and if you have setup ssh keys for myuser, you do not need passwords, and if you set this in crontab, then you can do this automatically.

to make a crontab entry, you can edit /etc/crontab (I often use the pico editor)

pico /etc/crontab

the format is like this:

MIN HOUR DOM MON DOW CMD

so to run the command every day at 22:00 you can make this line:

0 22 * * * rsync -avz /etc/deny.hosts myuser@<your host>:/etc/

or better yet is to make a script with all your rsync commands, and then run the script from crontab, but one line like this above should also work.

more options about Rsync can be found in the man page, and crontab man page

0
2

What's the difference between managing 10 servers and managing 1,000?

Nothing, if you did it right.

This is a job for configuration management. Look into Ansible/Cfengine/Chef/Puppet/etc.

4
  • 1
    I agree, but this doesn't really provide an answer per se. Mar 12, 2014 at 8:37
  • 1
    @vasilisyrakis this is a fine answer. The way you keep you server configurations in sync is by using configuration management software. Such as the four suggested. Mar 12, 2014 at 13:10
  • Thanks for th list of software, I'll take a look into it :) Mar 12, 2014 at 15:34
  • from the ones you mention, can you suggest one that you think is the best? and do you know any best places to start trying it?
    – Sverre
    Mar 12, 2014 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .