1.问题提示内容如下
命令:ssh -T git@github.com
ssh: connect to host ssh.github.com port 443: Connection refused
(端口也可以是默认的 22)
然后看了很多元芳怎么看
最后总结一下:ssh.github.com的域名解析被污染了。。。
然后去 https://ipaddress.com/website/ssh.github.com 查到该ip为140.82.114.36
然后修改C:\Users\xxx\.ssh下的config文件(没有就创建一个吧)
文件内容贴上(注意自己的有出入的哦,要改,这里id_ed25519要改成自己生产的文件名哦,比如id_rsa)
Host github.com
HostName 140.82.114.36 #ssh.github.com # **这是最重要的部分**
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_ed25519
2.最后测试一下(测试可以跳过)
ssh -T 140.82.114.36
结果是
The authenticity of host '140.82.114.36 (140.82.114.36)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/xxxvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '140.82.114.36' (ED25519) to the list of known hosts.
Ebl_314@140.82.114.36: Permission denied (publickey).
结果或者是:
$ ssh -T github.com
The authenticity of host '[140.82.114.36]:443 ([140.82.114.36]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/xxxSvHdkr4UvCOqU.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:1: github.com
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[140.82.114.36]:443' (ED25519) to the list of known hosts.
Hi badjane! You've successfully authenticated, but GitHub does not provide shell access.
3.最后推送代码over