用于上传的绑定接口:scp 有效,而不是 rsync

use*_*721 8 rsync scp bindings

我需要在特定界面上上传文件。这不能通过 iptables 设置,因为我的脚本在多个接口上输出。

这工作正常:

scp -oBindAddress=192.168.100.1 ...
Run Code Online (Sandbox Code Playgroud)

rsync --address=192.168.100.1
Run Code Online (Sandbox Code Playgroud)

仍在 eth0 (192.168.10.1) 上发送

我怎么能强制 rsync 使用 192.168.100.1 ?

任何的想法 ?

cjc*_*cjc 11

可以告诉 rsync 哪些 SSH 选项与“-e”开关一起使用。

尝试类似:

rsync -e 'ssh -oBindAddress=192.168.100.1'
Run Code Online (Sandbox Code Playgroud)