解决github 22端口被占用,改用443端口

530 阅读1分钟

在git push时突然出现以下报错

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

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

解决方法:修改生成的rsa所在地址~/.ssh下面的config文件,如果没有的话就自己手动新建一个 填入以下信息

Host github.com
HostName ssh.github.com  # 这是最重要的部分
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa