Rsync安全配置

本文介绍了如何安全配置Rsync,包括创建密码文件、设置共享配置、限制访问主机、定义用户权限,并提供了启动Rsync服务器的方法及示例用法。通过这些步骤,可以确保Rsync在传输数据时的安全性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

创建rsync的密码文件,格式 username:password

$ vi /etc/rsyncd.secrets

创建rsync共享配置文件

$ vi /etc/rsyncd.conf

添加如下内容:

pid file = /var/run/rsyncd.pid
port = 873 
uid = root
gid = root
use chroot = yes 
read only = no
max connections = 1000 
secrets file=/etc/rsyncd.secrets

#This will give you a separate log file
log file = /var/log/rsync.log
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300 


#For ACL
hosts allow = 10.0.0.0/255.0.0.0
hosts deny = *

[transcode]
path=/home/test
read only = no
uid=root
gid=root

auth users = root


启动rsync server:rsync --daemon /etc/rsyncd.conf 

用法:rsync -rvaq --password-file=/data/secret.txt --delete --exclude "*.pyc" --exclude ".git"  username@ip:transcode/test.txt .

注意事项:本机上的/data/secret.txt文件里只需要保存密码即可,用户名已经在命令中有了,并且权限应为600。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值