云服务器Git Pull/Git Push配置SSH代理
发布时间:2024-08-29 09:16
阅读量:1000
携手合作伙伴,实现业务上的双向合作共赢
我们为您提供全方位的支持与服务,确保您在使用我们的云服务时无忧无虑。
10+年商誉沉淀,深耕中国香港及海外高端资源
当git pull或push时经常会遇到Could not read from remote repository的报错,尤其是在启用Clash等代理软件后
# git push
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
此时我们可以通过配置SSH代理来保障网络通畅,添加~/.ssh/config文件,配置如下内容
# cat ~/.ssh/config
Host github.com
User git
Hostname github.com
Port 22
ProxyCommand nc -v -x localhost:7890 %h %p
ProxyCommand依赖nc,服务器上需要提前安装nc
# apt-get install ncat
服务热线:
18251482443电子邮箱:
202256327@qq.com商务QQ:
202256327公司地址:
江苏省连云港市东海县红星美凯龙S5-A133
客服微信
客服微信