Github – something about SSH and HTTPS

All the interactions with Github involve talking to a remote server that through a channel as default, either use ssh(22) or https(443). Depending on your environment, you might be in a situation where you have certain ports blocked.

The safest bet is to use SSH method all the time because if you don’t have SSH port open, you even cannot log into the box to do any operation. i.e., if you are even thinking about git clone..etc, you are probably already saying the SSH port is already open. Here is a detail tutorial demonstrating how to access git using ssh. In a short sentence, you need to copy you public ssh key and manually added it to your github account access group. And then you should be able to access your github account using ssh.

ssh

On github’s website, they also mentioned another scenario where “SSH is not fully enabled“, in that case, you can ssh into github using another commonly open port HTTPS(443) by using command “ssh -T -p 443 git@ssh.github.com” where -T will disable pseudo TTY allocation and -p will do port forward(which port to connect on the host side).

Also, it might be interesting to look at the format of repository address depending on which method you approach.

SSH: git@github.com:<username>/<reponame>.git

HTTPS: https://github.com/<username>/<reponame>.git

SSH(over 443): git@ssh.github.com:<username>/<reponame>.git

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s