Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom SSH Config Not Working

Tags:

git

port

ssh

I have been trying to get ssh to connect to Github using port 443 and I have decided to use a custom ssh config file at ~/.ssh/config. After creating the file and setting the proper file permissions I attempt to connect again, the connection is still timing out on 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 config file I add this:

Host pagodabox.io
  HostName git.pagodabox.io
  Port 443

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

Then I attempt to call this from my iTerm app.

$ ssh -T [email protected]

I get the error:

ssh: connect to host ssh.github.com port 22: Operation timed out fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

However, if I do this

$ ssh -T -p 443 [email protected] 

I get the desired response.

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

I am using oh-my-zsh FWIW. Why is this happening? I have rebooted my mac also. Still the file doesn't seem to be recognised

like image 981
Neo Avatar asked Dec 20 '22 01:12

Neo


1 Answers

You wrote:

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

But didn't use it:

 ssh -T [email protected]

You need to

 ssh -T [email protected]

to use the github.com host you defined.

like image 162
Toby Speight Avatar answered Dec 29 '22 20:12

Toby Speight