centos7安装rsync

以前用6装的,用7装就不知道了,琢磨了好久,
首先装xinetd
yum install xinetd
然后vim /etc/xinetd.d/rsync
正常没这个文件,我还是从6上面找的


# default: off
# description: The rsync server is a good addition to an ftp server, as it \
#       allows crc checksumming etc.
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=yes 这里默认是yes 改为no

然后systemctl restart xinetd.service
顺便看下873端口
[root@server11 xinetd.d]# lsof -i:873
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
xinetd 1962 root 5u IPv6 21422 0t0 TCP *:rsync (LISTEN)

服务正常
客户端那边
把12那边的网站代码拷贝过来,
rsync -azP –delete [email protected]:/var/www/html/ /var/www/html

无密码登陆
ssh-keygen一路回车
再执行
ssh-copy-id [email protected]

ssh [email protected]试试就可以了

整个过程比较简单,具体的rsync参数还是要调整的,用户这边肯定也不能用root的,

你可能感兴趣的:(Linux运维)