永夜-Evernight

永夜降临之前,你都有改变的资格

windows下rsync提示password file must be owned by root when running as root的解决办法

这算是个老问题了,每次在windows主机上通过cwrsync向服务端同步数据的时候都会遇到,这次总结记录下吧。错误代码为:

password file must be owned by root when running as root

在linux上设置rsync的时候,需要将passwordfile设置为600权限。所以在windows上我们也可以用其自带的chmod.exe 执行,其cwrsync客户端默认安装的位置是C:Program FilescwRsyncbin ,具体做法如下:

“C:Program FilescwRsyncbin” 600 /cygdrive/c/etc/password.txt

执行完以后,如果还有错误提示,可以使用chown.exe命令将其文件的属主做下更改。具体操作如下:

服务端:

chmod.exe -c 600 /cygdrive/c/etc/password.txt
chown.exe SvcCWRSYNC /cygdrive/c/etc/password.txt

SvcCWRSYNC为windows上的cwrsync-server安装时默认新建的一个用户。

客户端:

chmod.exe -c 600 /cygdrive/c/etc/password.txt
chown.exe administrator /cygdrive/c/etc/password.txt

默认客户端上没有chown.exe这个命令,直接从cwrsync-server的安装路径里拷贝一个过来就可以用了。windows的默认用户一般都是administrator,如果你不是以administrator登录的,请将上面命令中的administrator改成你当前使用的用户名。


标题:windows下rsync提示password file must be owned by root when running as root的解决办法
作者:luomuren
地址:http://luomuren.top/articles/2021/04/06/1617641072448.html