jqh*_*art 14 git ssh gitlab atlassian-sourcetree
我正面临一个奇怪的情况,我使用gitlab帐户来处理我的代码.我正在使用ssh协议来访问repo.我能够拉取代码但我在尝试推送代码时收到以下错误.这对我来说可能是愚蠢的.但我将密钥存储在我的gitlab配置文件中,并能够使用它来提取代码.
错误:
$ git push origin master
key_load_public: invalid format
Enter passphrase for key '/c/Users/username/.ssh/id_rsa':
Access denied.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
jqh*_*art 21
最后,我已经能够解决此问题,我将其发布给其他用户.如果putty生成的密钥无法帮助您访问gitlab repo,请尝试使用该命令从gitbash终端生成密钥ssh-keygen,并将文件保存在.ssh您的用户帐户的文件夹中.
Linux风格的密钥生成使我的生活变得轻松,因为我试图用putty keygen在windows环境中生成密钥.
希望这有助于某人.
小智 16
PuTTYGen可以生成正确的OpenSSH密钥.