分享

rsync限制同步文件权限,配置目录755权限

 dtl乐学馆 2014-12-08

刚刚同事反映开发机上的测试站点无法访问,提示500错误;直接检查了网站根目录权限,发现变成了000,原来开发人员用rsync从本地同步文件到服务器上时把属性全部改变了,查了查rsyncd.conf的帮助文档,找到incoming chmod这个配置参数。配置后用户同步文件会强制把权限改为server端设定值。

incoming chmod
This option allows you to specify a set of comma-separated chmod strings that will affect the permissions of all incoming files (files that are being received by the daemon). These changes happen after all other permission calculations, and this will even override destination-default and/or existing permissions when the client does not specify --perms. See the description of the --chmod rsync option and the chmod(1) manpage for information on the format of this string.

在rsyncd.conf中加上一行:
incoming chmod = Du=rwx,Dog=rx,Fu=rwx,Fgo=rx
就会强制把同步以后的目录权限改为755.就解决一目录权限改变的问题。

.abu.点评:
群里聊天时候的一些搜集。



    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多