SSH user configuration not working

I am trying to get ssh to connect to Github using port 443, and I decided to use the custom ssh configuration file in ~/.ssh/config . After creating the file and setting the correct file permissions, I try to connect again, the connection is still synchronized with port 22. I know this because port 22 is blocked by my ISP (for some strange reason).

 $ cd ~/.ssh $ touch config $ chown $USER config $ chmod 644 config 

Then in the configuration file I add the following:

 Host pagodabox.io HostName git.pagodabox.io Port 443 Host github.com HostName ssh.github.com Port 443 

Then I try to call this from my iTerm application.

 $ ssh -T git@ssh.github.com 

I get an error message:

ssh: connect to ssh.github.com host 22: fatal response time: could not be read from the remote repository.

Please make sure that you have the correct permissions and the repository exists.

However, if I do this

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

I get the desired response.

Hi [Username]! You have successfully authenticated, but GitHub does not provide shell access.

I am using oh-my-zsh FWIW. Why is this happening? I also rebooted my Mac. However, the file does not seem to be recognized

+4
source share
1 answer

You wrote:

  Host github.com HostName ssh.github.com Port 443 

But did not use it:

  ssh -T git@ssh.gith ub.com 

You need

  ssh -T git@github.com 

to use the github.com host that you defined.

+10
source

All Articles