按照githbub 官网的方法
1.生成 new ssh key and adding it to the ssh-agent
2.adding the new ssh key to your GitHub account.
3.testing your ssh connection
ssh -T git@github.com
提示:ssh_exchange_identification: disconnect by remote host.
加参数:debug:
ssh git@github.com -vvv
debug 信息
OpenSSH_7.2p2, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [1.111.11.111] port 22.
debug1: Connection established.
debug1: identity file /Users/leidu/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/leidu/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2
ssh_exchange_identification: Connection closed by remote host
百度对应上边github.com IP
IP地址: 1.111.11.111 韩国
happy end 被运营商劫持。
在hosts 里添加 如何添加?点我
192.30.253.112 gitHub.com
--end--