github推送Please make sure you have the correct access rights and the repository exists.

A: github推送和拉取报错:

kex_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Q: 我选择重新生成SSH key,具体步骤如下:

  1. 本地生成SSH key

    ssh-keygen -t rsa -C "example@example.com"
    

    生成SSH Key的秘钥对:id_rsaid_rsa.pub,id_rsa是私钥,不能泄露,id_rsa.pub是公钥,可以公开,分别的默认生成路径为
    Windows:C:\Users\$Name\.ssh
    Ubuntu:~/.ssh

  2. 配置GitHub
    点击右上角头像 ==》选择Settings ==》左侧菜单栏选择SSH and GPG keys ==》点击SSH keys区域的New SSH key ==》复制本地id_rsa.pub 到Key区域并在Title区域命名。

  3. 验证连接情况
    执行命令

    ssh -T git@github.com
    

    初次设置会提醒Are you sure you want to continue connecting (yes/no/[fingerprint])?,输入yes
    如果是kex_exchange_identification: read: Connection reset by peer请看后续问题。

A1: 执行ssh -T git@github.com提示kex_exchange_identification: read: Connection reset by peer
Q1: 到密钥生成的文件夹执行以下命令

ssh-add id_rsa

A2: 执行ssh-add id_rsa报错Could not open a connection to your authentication agent.
Q2: 执行以下命令

ssh-agent bash
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值