MeltingDog MeltingDog - 1 month ago 9
Git Question

Cannot connect to Github via ssh, cannot access .ssh.config

I'm new to Git and command line. I am using a Vagrant virtual box.

Today, I tried pushing some work to Github and got the error:


connect to host github.com port 22: Connection refused


A SE post suggested I try to use:
ssh -T -p 443 git@ssh.github.com,
but I got the same message:


connect to host ssh.github.com port 443: Connection refused


Another post suggested I check the ssh config settings with
~/.ssh/config
, but I get:


zsh: permission denied: /home/vagrant/.ssh/config


I'm not really sure what to do next. Can anyone point me in the right direction?

Answer

I don't know if you follow this link, but it is very helpful.

You are having permission denied to access ~/.ssh/config because this file, just can be edited by the machine admin.

If you are de admin, do sudo vim ~/.ssh/config and then enter with your password and edit the file.

Sometimes, the ssh problem is because you have changed your ssh key, so if the problem insists, remove ssh keys and add then again

sudo rm -rf ~/.ssh/ (WARNING: THIS WILL REMOVE ALL SSH KEYS)

Comments