【记录】github提交ssh22端口无法连接

报错

1
2
3
4
5
6
$ git pull
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.

解决

~/.ssh 下创建 config 文件
User 修改为自己邮箱
IdentityFile 修改公钥地址

1
2
3
4
5
6
Host github.com
User rocyuan666@163.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_ed25519
Port 443