rsync 无密码传输文件

时间:2023-03-08 17:32:06

最近机器迁移,需要备份文件,但各个机器间不能穿梭,即无法通过scp来传输文件,

在运维的建议下,选用了rsync作为传输的工具。

默认情况Ubuntu安装了rsync服务,但在/etc下没有配置文件,一般情况可以copy示例文件到/etc下。

配置无帐号登录的示例如下,需要主要高亮的部分。

[mail]
comment = public archive
path = /tmp/mail/
use chroot =
no
# max connections=
lock file = /var/lock/rsyncd
# the default for read only is yes...
read only = no
list = yes
uid = service
gid = admin
# exclude =
# exclude from =
# include =
# include from =
# auth users = service
# secrets file = /etc/rsyncd.secrets
strict modes =
no
# hosts allow =
# hosts deny =
ignore errors = no
ignore nonreadable = yes
transfer logging = no
# log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
timeout =
refuse options = checksum dry-run
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz