When using GitHub via SSH, port 22 will be used per default. However, often times you’ll see this port being blocked on public WIFI networks. On a Linux machine, there is a simple way to change the default port.

To test if our plan works out, you can use the following command:

>ssh -T -p 443 git@ssh.github.com

This will test the ssh connection by using port 443. If this returns a positive result, you can change the port in your ssh config file.

You can find the SSH configuration in ~/.ssh/config. To change the port, open the file and add a new entry for github, which will look like this:

>Host github.com
  Hostname ssh.github.com
  Port 443

You can use whatever port you’d like. I’m using port 443, which is the default HTTPS port. That is also the one GitHub recommends to use in their documentation. Save your changes and you will be able to work as you’re used to.