一、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 "XXX@XX.com" /*github上的注册邮箱为用户账号*/

Hostname ssh.github.com /*服务器地址为github地址*/

PreferredAuthentications publickey /*采用公匙*/

IdentityFile ~/.ssh/id_rsa /*公匙文件路径*/

Port 443 /*修改端口为443*/
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐