我想使用rsync
SSH 上传文件。
在服务器端我有:
在/root/.ssh/rsync.conf
:
uid = root
gid = root
use chroot = false
[data]
path = /var/www/data
我/root/.ssh/authorized_keys
有:
command="rsync --server --daemon --config rsync.conf ." ssh-rsa AAAAB3N...
在客户端我有ssh_config
如下文件:
Host rsync_data
User root
IdentitiesOnly yes
IdentityFile /home/me/.ssh/id_rsa_rsync
ProxyCommand ssh eu -W 172.17.16.16:22
Host eu
User me
Port 4343
Hostname My_Public_IP_Address_here
IdentitiesOnly yes
IdentityFile /home/me/.ssh/id_rsa_rsync
最后,启动的命令是:
rsync \
--delete \
-avz \
--stats \
--progress \
-e 'ssh -F /home/me/.ssh/config' \
/home/me/Documents/dev/data/ rsync_data::data
SSH 连接读入顺利,/var/log/auth.log
但我收到此 rsync 错误:
rsync error: syntax or usage error (code 1) at clientserver.c(1223 [Receiver=3.2.3]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.2.7]
我该如何解决我遇到的问题?