脚本之家

电脑版
提示:原网页已由神马搜索转码, 内容由www.jb51.net提供.
您的位置:主页> 软件教程> 网络通讯> rsync password file must not be othe

rsync 免密方式远程同步文件时 password file must not be other-accessible

  发布时间:2024-06-07 19:38:01  作者:佚名  我要评论
今天做rsync远程同步时,为了从备份源站点中使用免密方式同步文件,但提示password file must not be other-accessible,原来默认的权限太高了,不能随意让别的用户访问

故障现象

今天做rsync远程同步时,为了从备份源站点中使用免密方式同步文件,当时在发起端输入了以下命令,

[root@localhost etc]# rsync -az --delete --password-file=/etc/server.pass backuper@14.0.0.10::wwwroot /opt/

提示了如下报错:

故障排查和解决方法

根据报错提示的英文语句进行翻译:
密码文件不能被其他用户访问。
原来是密码文件只能被属主读取和写入,不能被其他用户读取,这是不安全的!
而创建的文件默认权限是644,需要将其设为600

[root@localhost etc]# ll | grep server.pass
-rw-r--r--.  1 root root     7 9月  10 16:43 server.pass

所以需要输入以下命令来设置密码文件的权限:

[root@localhost etc]# chmod 600 server.pass
[root@localhost etc]# ll | grep server.pass  #检查一下权限是否改变
-rw-------.  1 root root     7 9月  10 16:43 server.pass

相关文章

最新评论