Jllin

rsync server 部署
服务端mkdir /etc/rsyncd vi /etc/rsyncd/rsyncd.conf uid = r...
扫描右侧二维码阅读全文
14
2018/10

rsync server 部署

服务端

mkdir /etc/rsyncd

vi /etc/rsyncd/rsyncd.conf

uid = root
gid = root
hosts allow = *
use chroot = yes
max connections = 10
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
logf ile = /var/log/rsyncd.log
timeout = 600
port = 873

[sh1]
path = /data1
read only = yes
comment = Rsync File
write only = no
list = no
auth users = rsync
secrets file = /etc/.rsyncd.secrets

[sz1]
path = /data2
read only = yes
comment = Rsync File
write only = no
list = no
auth users = rsync
secrets file = /etc/.rsyncd.secrets
  

vi /etc/.rsyncd.secrets

rsync:passwd
  

cat /etc/xinetd.d/rsync

# 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/local/bin/rsync
 server = /usr/bin/rsync
 server_args = --daemon --config=/etc/rsyncd/rsyncd.conf
 log_on_failure += USERID
}
 

/etc/init.d/xinetd restart

客户端

cat /etc/.rsyncd.secrets

passwd


上传:

rsync -vzrtopg --delete --progress test.sh rsync@192.168.2.221::sh1 --password-file=/etc/.rsyncd.secrets 

下载:

rsync -vzrtopg --delete --progress rsync@192.168.2.221::sh1 /data --password-file=/etc/.rsyncd.secrets

参考:

http://www.linuxidc.com/Linux/2015-06/119368.htm
https://www.cnblogs.com/JohnABC/p/6203524.html

Last modification:October 15th, 2018 at 01:53 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment