github上传项目的时候报权限错误

报出git@github.com: Permission denied (publickey). fatal: Could not read from remote repo 类似错误

解决方法

  1. 当前项目内输入命令:ssh-keygen -t rsa -C ["xxxxxxxx@qq.com](mailto:"876818551@qq.com)"

  2. 接下来输入命令:cat ~/.ssh/id_rsa.pub

  3. 接下来输入git push --set-upstream origin master

  4. 复制里面的key。

  5. 从github主页点击设置进入SSH and GPG keys

  6. 点击创建一个新的密钥"New SSH key",

  7. 粘贴key。

如果配置了SSH密钥后,首次上传git代码继续报权限错误
unable to access 'https://github.com/xxxxxxxxx/test-app.git/': OpenSSL SSL_read: Connection was reset, errno 10054

解决方法

git remote rm origin

// 使用http明文传输
git remote add origin http://github.com/xxxxxxxxx/test-app.git/

//上传完成后,将远程地址改为
posted @ 2021-11-11 15:32  AvenCheung  阅读(112)  评论(0编辑  收藏  举报