[root@from ~]# vi /etc/lsyncd.conf ← lsyncd設定ファイル作成
settings {
statusFile = "/tmp/lsyncd.stat",
statusInterval = 1,
}
sync{
default.rsync,
source="/root/", ← ミラー元ディレクトリ
target="xxx.xxx.xxx.xxx:/tmp/root/", ← ミラー先(rsyncサーバー)IPアドレス:ミラー先ディレクトリ
rsync = {
archive = true,
links = true,
update = true,
verbose = false
}
}
[root@from ~]# ssh-keygen -t rsa -N "" ← RSA鍵ペア(公開鍵/秘密鍵)作成
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): ← 空ENTER
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
09:6c:eb:5a:f7:01:fa:32:1b:8c:b2:82:48:b7:c1:c3 root@from.centossrv.com
[root@from ~]# scp .ssh/id_rsa.pub ミラー先IPアドレス:/root/.ssh/authorized_keys2 ← RSA鍵(公開鍵)をミラー先へコピー
|
|