Issue: can't use ssh or git commands when connected on VPN. This is because, for now, outgoing ssh / TCP 22 is blocked.
We have to tunnel through the web proxy. Here is how:
- Download and install
nmap-7.70-setup.exefrom https://nmap.org/download.html. We will usencattool to send all packets through the proxy. - Open command line (WIN Key+R+
cmd+ENTER) cd %USERPROFILE%\.ssh. This is where you have stored your ssh private key for GitHub- Create a new file named
config - Add
Host github.com
Hostname github.com
port 22
ProxyCommand ncat --proxy <your-http-proxy>:8080 %h %p
identityfile ~/.ssh/github.privatekey.pem
- We will use
ncto send all packets through the proxy. - Edit
~/.ssh/config:nano ~/.ssh/config| - Add
Host github.com
Hostname github.com
port 22
ProxyCommand nc -X connect -x your-http-proxy:8080 %h %p
identityfile ~/.ssh/github.privatekey.pem
- If you use ArchLinux, you can use socat:
ProxyCommand socat - PROXY:web-proxy:%h:%p,proxyport=8080 - Issue
chmod 400 ~/.ssh/configto set permissions right for this file
📝 Replace "web-proxy" with the proper web proxy which works at your site, and
github.privatekey.pemwith your actual private key file.
You can then use git commands as usual, with git URLs:
git clone [email protected]:your_user/your_repo.git
ProxyCommand line in your ssh/config.