Bootstrap

解决ssh: connect to host github.com port 22: Connection refused

ssh: connect to host github.com port 22: Connection refused是连接github.com的端口号22拒绝连接
22端口拒绝连接,我们可以使用443端口号进行连接

解决方案

  1. 打开git bash窗口
  2. 输入vim ~/.ssh/config
  3. 添加如下字段
    如果没有config 文件就新建一个
    Host github.com
    Hostname ssh.github.com
    Port 443
    
  4. 测试连接
    ssh -T [email protected]
    
    如果出现以下内容,输入yes即可
    The authenticity of host ‘[ssh.github.com]:443 ([20.205.243.160]:443)’ can’t be established.
    ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    最终显示Hi chengyun-pg! You’ve successfully authenticated, but GitHub does not provide shell access.,可能会比较慢,耐心等待。
;