Rsync 在非标ssh端口(22) 中用法
这篇文章(560e1356d908de0d2585d058)是从 Teambition 迁移过来的
问题
使用rsync拷贝文件,有个主机的ssh端口使用的并非标准端口(22),查看rsync的文档,看到有种带有端口的用法:
rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST但使用会返回错误:
rsync: server sent "SSH-2.0-OpenSSH_5.3" rather than greeting
rsync error: error starting client-server protocol (code 5) at main.c(1534) [sender=3.0.9]解决
开始以为是客户端服务器rsync版本不兼容,后来发现对于非标准ssh端口(22)的使用方法是使用-e参数:
rsync [OPTION]... -e "ssh -p 2222" SRC [SRC]... [USER@]HOST[:PORT]/DEST