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

Jeremy Dicaire
  • 165
  • 1
  • 5
  • 15

2 Answers2

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

Sverre
  • 753
  • 2
  • 12
  • 23
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.

toppledwagon
  • 4,245
  • 25
  • 15