Showing posts with label proxy. Show all posts
Showing posts with label proxy. Show all posts

Wednesday, April 14, 2021

Tip: git can't communicate with github after unset http.proxy

Symptom:

    We used to have an HTTP proxy to access Github. It was working fine. When we take off HTTP proxy via "git config --global -e", use "git config --global -l" to confirm it is taken off.

   However, it still can't communicate with GitHub. Error like 

 kex_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository

Reason:

   It is due to we use ssh to communicate with GitHub, while there are extra HTTP proxy settings in ~/.ssh/config file

Host=github.com

ProxyCommand=socat - PROXY:<proxy-server>:%h:%p,proxyport=80

Take them off will fix the issue. 


Monday, May 06, 2019

SSH via Proxy Socat Connect Tips

Use SOCAT in Linux

ssh -oIdentityFile=VM-PrivateKey.txt -o ServerAliveInterval=5 -o ProxyCommand='socat - "proxy:<proxy server>:%h:%p,proxyport=80"' opc@<hostname or ip address>

Use CONNECT in Git Bash

ssh -oIdentityFile=VM-PrivateKey.txt -o ServerAliveInterval=5 -o ProxyCommand="connect  -H  <proxy server>:80  %h %p"  opc@<hostname or ip address>