git的ssh公钥配置失败

git ssh配置失败
ssh: connect to host github port22 permission denied

img

connect to host github.com port 22:permission denied,如何解决

22端口可能被防火墙屏蔽了,可以尝试连接GitHub的443端口。

$ vim ~/.ssh/config

# Add section below to it
Host github.com
  Hostname ssh.github.com
  Port 443

解决方式: 找到git安装目录 进入etc/ssh文件夹内,找到ssh_config文件,在# Added by git-extra后面添加t替换代码具体参考下面

Host *
  IdentityFile ~/.ssh/id_rsa
  HostkeyAlgorithms +ssh-rsa
  PubkeyAcceptedAlgorithms +ssh-rsa


https://blog.csdn.net/weixin_45260049/article/details/125503830