Connecting to Github from remote server via shared internet

Viewed 151

I have shared my local internet by an offline remote server using this documentation. Everything is working, the remote server has internet now. Most of things like apt, curl, etc is working. But when I want to connect to github via command below:

ssh -T git@github.com

I get this error:

ssh: Could not resolve hostname github.com: Temporary failure in name resolution

Could anyone help please?

1 Answers

If curl is working, but not SSH, try at least to clone with HTTPS:

git clone https://github.com/<me>/<myRepo>

You might then have to define a proxy (HTTP_PROXY/HTTPS_PROXY), if needed, with a NO_PROXY set to "127.0.0.1,localhost,.mycompany.com".

Still using ssh would mean, as suggested by the OP:

  • git config https.proxy http://a/proxy
  • using bryanpkc/corkscrew, a tool for tunneling SSH through HTTP proxies

(Assuming this does not go against local IT policy)

See for instance "Using Corkscrew to tunnel SSH over HTTP" from Vincent Danen:

edit your SSH configuration file, ~/.ssh/config, and add:

Host somehost
   Hostname somehost.example.com #ssh.github.com for Github
   Port 443 #443 for Github
   ProxyCommand /user/bin/corkscrew proxy.example.com 3129 %h %p

OpenSSH transparently converts the %h to the hostname to connect to (somehost.example.com) and the port to connect to (22, by default).

The ProxyCommand line here is telling OpenSSH to start the Corkscrew program to make the actual connection to the end SSH server. > You can create multiple entries for all of the hosts you may need to connect to, or use a simple regular expression or the global asterisk (*) in the Host line (* will tell OpenSSH to use this Host stanza for all connections).

Related