Git Pull/Git Push配置SSH代理
Git Pull&Git Push配置SSH代理
藍(lán)隊(duì)云小課堂:
當(dāng)git pull或push時(shí)經(jīng)常會(huì)遇到Could not read from remote repository的報(bào)錯(cuò),尤其是在啟用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.
此時(shí)我們可以通過(guò)配置SSH代理來(lái)保障網(wǎng)絡(luò)通暢,添加~/.ssh/config文件,配置如下內(nèi)容
# cat ~/.ssh/config
Host github.com
User git
Hostname github.com
Port 22
ProxyCommand nc -v -x localhost:7890 %h %p
ProxyCommand依賴(lài)nc,服務(wù)器上需要提前安裝nc
# apt-get install ncat
更多小知識(shí),可聯(lián)系藍(lán)隊(duì)云一起探討。
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)