项目场景:
Pycharm 配置远程同步后,rsync 报错:1)failed: No such file or directory ;2) Too many authentication failures
客户端:MAC M2芯片 MACOS 13.5.1
服务端:linux Ubuntu 18.04 内网连接
问题描述
在pycharm选择Download from here 从现场同步数据回来发现报错
[2024/3/5, 10:03] Failed to transfer folder '$homepath/paddleocr-project/Doc-scan-main/Scan/test_draw.py'. Unknown message with code "Rsync failed with exit code: 14".
[2024/3/5, 10:06] Download from 服务器-内网-sftp
[2024/3/5, 10:06] Download '$homepath/paddleocr-project/text-ocr/en_PP-OCRv3_rec.yml' to '$homepath/paddleocr-project/text-ocr/en_PP-OCRv3_rec.yml' using rsync
[2024/3/5, 10:06] /usr/bin/rsync -vae -e "ssh -p 22 " --exclude=.svn --exclude=.cvs --exclude=.idea --exclude=.DS_Store --exclude=.git --exclude=.hg --exclude=*.hprof --exclude=*.pyc mz@192.168.1.166:$homepath/paddleocr-project/text-ocr/en_PP-OCRv3_rec.yml en_PP-OCRv3_rec.yml
[2024/3/5, 10:06] building file list ... rsync: link_stat "$homepath/paddleocr-project/text-ocr/ssh -p 22 " failed: No such file or directory (2)
[2024/3/5, 10:06] rsync: link_stat "$homepath/paddleocr-project/text-ocr/mz@192.168.1.166:$homepath/paddleocr-project/text-ocr/en_PP-OCRv3_rec.yml" failed: No such file or directory (2)
[2024/3/5, 10:06] done
原因分析:
-
问题1)
查看pycharm执行的命令:/usr/bin/rsync -vae -e "ssh -p 22 "
发现有重复命令-e
-
问题2)
mac 环境问题: 参考 https://www.cnblogs.com/liugx/p/5118622.html
解决方案:
在pycharm上设置如下解决问题1)和 问题2):
Tools – Deployment – configuration选择配置好的SFTP服务
选择Rsync Settings
,配置 Rsync option
为 -va
,Sheel executable path
为 /usr/bin/ssh -o PubkeyAuthentication=no
( /usr/bin/ssh
为ssh在本mac 上所在路径 )
注意:如果采用的是私钥配置的方式,那么需要去掉“-o PubkeyAuthentication=no”,配置为