본문 바로가기

Linux

[CentOS] Rsync 설치하기

반응형


1. rsync 설치 확인


     1) rsync 패키지 확인

[root@tourWeb1 ~]# rpm -qa | grep rsync


     2) rsync 패키지 없을시 yum을 통해 설치

[root@tourWeb1 ~]# yum -y install rsync




2. Rsync 설정


     1) rynsc 설정파일 작성

[root@tourWeb1 ~]# vi /etc/rsyncd.conf 


[test]
path = /data/test
comment = test Rsync
uid = nobody
gid = nobody
use chroot = yes
read only = yes
hosts allow = *
max connections = 10
timeout = 30 



     2) xinetd rsync 설정파일 수정

[root@tourWeb1 ~]# 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
}

* disable을 no 로 변경



     3) xinetd 재구동

[root@tourWeb1 ~]# service xinetd restart





3. 방화벽 오픈


     1) iptables 포트규칙 추가

[root@tourWeb1 ~]# vi /etc/sysconfig/iptables 


-A INPUT -m state --state NEW -m tcp -p tcp --dport 873 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 873 -j ACCEPT



     2) iptables 재구동

[root@tourWeb1 ~]# service iptables stop
[root@tourWeb1 ~]# service iptables start



     3) SeLinux 중지 (방화벽 정책을 오픈했음에도 연결이 안될경우 해당방법 참고)

[root@tourWeb1 ~]# setenforce 0
[root@tourWeb1 ~]# vi /etc/sysconfig/selinux


SELINUX=disabled

* SELINUX 부분을 disabled로 변경한다.