실습> rsync server/client 구성하기
rsync Server : 192.168.101.100
rsync Client : 192.168.101.101
1. rsync 서버 설정
web2: 192.168.101.100
[root@web2 ~]# yum -y install rsync xinetd
xinetd 설정 파일을 생성한다.
[root@web2 ~]# vi /etc/xinetd.d/rsync
service rsync
{
disable = no
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
rsyncd 설정 파일을 생성한다.
[root@web2 ~]# vi /etc/rsyncd.conf
[EVER_LOG]
path = /var/log
comment = logBackup
uid = root
gid = root
use chroot = yes
read only = yes
max connections = 1
pid file = /var/run/rsyncd.pid
transfer logging = yes
timeout = 600
hosts allow = 192.168.101.101
#ignore nonreadable = yes
#dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
2. 서버 시작
[root@web2 ~]# systemctl start xinetd
[root@web2 ~]# systemctl enable xinetd
[root@web2 ~]# yum -y install net-tools
[root@web2 ~]# netstat -nltp | grep 873
tcp6 0 0 :::873 :::* LISTEN 1287/xinetd
3. rsync 클라이언트 설정
web1: 192.168.101.101
[root@web1 ~]# yum -y install rsync
[root@web1 ~]# rsync -avz 192.168.101.100::
EVER_LOG logBackup
[root@web1 ~]# setenforce 0 <-- 임시로 설정
[root@web2 ~]# setenforce 0 <-- 임시로 설정
[root@web1 ~]# rsync -avz 192.168.101.100::EVER_LOG /backup/log
:
:(생략)
[root@web1 ~]# ls /backup/log/ -l
합계 940
drwxr-xr-x. 2 root root 204 3월 3 2022 anaconda
drwx------. 2 root root 23 3월 3 2022 audit
-rw-------. 1 root root 16710 3월 2 20:30 boot.log
-rw-------. 1 root utmp 0 3월 3 2022 btmp
drwxr-xr-x. 2 chrony chrony 6 8월 8 2019 chrony
-rw-------. 1 root root 2243 3월 2 21:01 cron
-rw-r--r--. 1 root root 123148 3월 2 20:30 dmesg
-rw-r--r--. 1 root root 123219 3월 3 2022 dmesg.old
-rw-r-----. 1 root root 186 3월 3 2022 firewalld
-rw-r--r--. 1 root root 193 3월 3 2022 grubby_prune_debug
drwx------. 2 root root 41 3월 2 17:40 httpd
-rw-r--r--. 1 root root 292000 3월 2 20:31 lastlog
-rw-------. 1 root root 384 3월 2 20:30 maillog
-rw-------. 1 root root 287511 3월 2 21:50 messages
drwxr-xr-x. 2 root root 6 3월 3 2022 rhsm
-rw-------. 1 root root 7320 3월 2 21:42 secure
-rw-------. 1 root root 0 3월 3 2022 spooler
-rw-------. 1 root root 64000 3월 2 17:24 tallylog
drwxr-xr-x. 2 root root 23 3월 3 2022 tuned
-rw-rw-r--. 1 root utmp 6528 3월 2 20:31 wtmp
-rw-------. 1 root root 2412 3월 2 21:38 yum.log
'Linux > 보안장비 운용' 카테고리의 다른 글
| rsync + 날짜별로 백업하기 (0) | 2022.03.03 |
|---|---|
| rsync 디렉터리 추가하기 (0) | 2022.03.03 |
| 백업 (1) | 2022.03.03 |
| pfsense 방화벽 설치하기 (1) | 2022.03.03 |
| UTM 에서 LVS 설정하기 (0) | 2022.03.03 |