一、github默认端口22被占用,出现github 连接错误
kex_exchange_identification: read: Connection reset by peer
Connection reset by IP port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
二、修改方法
切换到 cd ~/.ssh/
进入到~目录下面的.ssh下面,新建config文件,添加以下配置:
Host github.com /*服务器地址为github地址*/
User "[email protected]" /*github上的注册邮箱为用户账号*/
Hostname ssh.github.com /*服务器地址为github地址*/
PreferredAuthentications publickey /*采用公匙*/
IdentityFile ~/.ssh/id_rsa /*公匙文件路径*/
Port 443 /*修改端口为443*/