Rsync安全配置
2015-09-28 16:06
531 查看
创建rsync的密码文件,格式
创建rsync共享配置文件
添加如下内容:
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。
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。
相关文章推荐
- android AlertDialog.Builder(Context context)换行
- ldd3 源码相关问题参见
- Hash表
- Volley在没有网的情况下使用磁盘缓存的数据
- Java编写猜数字小游戏
- ssoj1338蜘蛛侠 trampolin
- NOIP 2006 金明的预算方案|动态规划
- 长度限制计算长度与服务器计算长度不符
- 感觉被割裂了
- TCP和UDP的区别
- Oracle中如何用SQL检测字段是否包括中文字符
- 电脑开机提示 NTLDR is missing
- Java IO 之 InputStream源码
- SQLHelper---赵晓虎(简洁,全面)
- 如何调试分析Android中发生的tombstone
- noip2011 选择客栈 (枚举)
- hack with python(二)
- TextView的尾部追加string核心代码
- Android 信号处理面面观 之 信号定义、行为和来源
- ANDROID内存优化(大汇总——中)