![rsync:在 io.c(254) [sender=3.1.2] 处未找到远程命令(代码 127)](https://linux22.com/image/781565/rsync%EF%BC%9A%E5%9C%A8%20io.c(254)%20%5Bsender%3D3.1.2%5D%20%E5%A4%84%E6%9C%AA%E6%89%BE%E5%88%B0%E8%BF%9C%E7%A8%8B%E5%91%BD%E4%BB%A4%EF%BC%88%E4%BB%A3%E7%A0%81%20127%EF%BC%89.png)
为了在本地文件服务器和远程网络空间(使用 ssh 和 rsync 访问)之间建立备份,我想要使用 rsync。
使用命令
rsync -aPv -e "ssh -vv IonosSB" --delete /volume1/fff/sss/ [email protected]:aaa/fff/sss
我收到错误消息:
...
bash: home123456789.hostdomain.host: command not found
debug2: channel 0: written 55 to efd 6
debug2: channel 0: obuf empty
debug2: channel 0: chan_shutdown_write (i3 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2604, received 2936 bytes, in 0.1 seconds
Bytes per second: sent 36892.2, received 41595.8
debug1: Exit status 127
rsync error: remote command not found (code 127) at io.c(254) [sender=3.1.2]
该文件~/.ssh/config
包含以下内容:
Host IonosSB
HostName home123456789.hostdomain.host
User u12345678
Port 22
IdentityFile /volume1/Data/System/keys/abcdef.key
这与 ssh 配合得很好,ssh IonosSB
成功输入后无需输入密码即可在远程服务器上启动会话。
手动使用 rsync 也可以:
rsync -aPv --delete /volume1/fff/sss/ [email protected]:aaa/fff/sss
手动输入密码后成功运行同步。
所以
- ssh 使用证书进行配置定义,不需要输入密码
- rsync 无需 ssh 配置,只需手动输入密码即可运行
- rsync 使用带证书的 ssh 配置失败
到目前为止,我还不知道该去哪里寻找原因和治疗方法。任何帮助都感激不尽。
答案1
附加测试:
输入命令
rsync -aPv -e "ssh -i /volume1/Data/System/keys/abcdef.key" --delete /volume1/fff/sss/ [email protected]:aaa/fff/sss
运行良好,没有错误消息。
那么有什么不同呢:
直接通过 -i 选项还是通过配置文件输入证书?