ssh: connect to host github.com port 22: Operation timed out 에러

profile image pIutos 2022. 10. 2. 00:59

문제 발생

git push를 하려 했을 때 다음과 같은 에러가 발생했다.

ssh: connect to host github.com port 22: Operation timed out
Please make sure you have the correct access rightsand the repository exists.

해결 방법

1. ~/.ssh/config 경로의 config파일에 아래 텍스트를 입력한 후 저장한다

Host github.com
Hostname ssh.github.com
Port 443
User git

2. 이후 ssh -T git@github.com 커맨드를 실행한다.

3. Are you sure you want to continue connecting (yes/no/[fingerprint])? 에서 yes를 입력하면 해결된다.

해결 상세

나의 경우 맥을 사용해서, config파일에 텍스트를 입력한 후, 터미널에서 커맨드를 실행했다.

숨김파일을 보기 위해서는 finder에서 command + shift + .(점) 을 입력하면 된다.

참고 링크

https://stackoverflow.com/questions/15589682/ssh-connect-to-host-github-com-port-22-connection-timed-out

 

ssh: connect to host github.com port 22: Connection timed out

I am under a proxy and I am pushing in to git successfully for quite a while. Now I am not able to push into git all of a sudden. I have set the RSA key and the proxy and double checked them, with no

stackoverflow.com

https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port

 

Using SSH over the HTTPS port - GitHub Docs

GitHub Enterprise Server users: Accessing GitHub Enterprise Server via SSH over the HTTPS port is currently not supported. To test if SSH over the HTTPS port is possible, run this SSH command: $ ssh -T -p 443 git@ssh.github.com > Hi username! You've succes

docs.github.com