4
我在Windows 10上使用puttygen.exe來生成私鑰和公鑰。我保存在C:\ Users \ Alexander \ .ssh \Git clone。 key_load_public:格式無效權限被拒絕(publickey)
公鑰已被添加到遠程回購(不是由我。我沒有訪問權限)。
然後我用在GIT中擊命令:
git clone [email protected]:project_name.git
而且我得到一個錯誤:
key_load_public: invalid format
Permission denied (publickey).
fatal: Could not read from remote repository.
實施例鍵(只是舉例生成)
id_rsa.ppk
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: rsa-key-20170110
Public-Lines: 6
AAAAB3NzaC1yc2EAAAABJQAAAQEAx0UhtZcgUT5XpoNlcoVFGHbArEsARQVCv5m0
TRh90Xq15gxOvL+x7I0B29xOuOP054RtQaOzHqnKUzpMdrIoZFkYEYJ11p42kC05
PVR/CwtKBuONJZzoIveJlNG1IhbC3G8DMZD5j68T5OVbCqftHMIBe4CTr7TewJ9T
/lmSZPytWXk/Xtcvn1i1TQZS2ShtSNOwtx77fLzkVmC6F4uM2JgJ9bSM2xQZTX/j
DYZTtoEsmyBadANAEZx4kQAoITwxXVRPBPJnB74EdSMXNhrDBJ+sZSEy7kxmc3a/
UK6CzdN3wiEMd/Bb1nuzR2cpWrWhniG66lnOTJb3sF8iiVtw7Q==
Private-Lines: 14
AAABAEtmRBsyQ5RcxzgWCrW14sr8gEExIrJVBH/ZSyQXGtmkDXmjysP1gZfGpsHk
qCpIaoEdWcXPPNsrfPzloGRDaTq57W5otvdCyImUkjLhs4ejaB5IQz6qEqVya2i+
DS9+O+S0YhLBO9WAhBFrijtiIl3oivB11wQ2mXlRCwZLZ9MugQ3rPfS0O/E2asrO
+MyiR2uv84lVb2wUT0Be3eeubnT2Qp8CoX3qV93LwBM053tepmD0jtSBsaXepADw
mdjBfIkUm+z/69PKtsEoYtIRe5DQRGQhUrwZasJnrfwAvdkr56NKM/rEL0ocUPDX
pXQalD88fKHKog5pr25c8aImklUAAACBAPmqhoRBWy+VJxgZ2BeMYv2PbmQCrQyp
ZVqua9byU59cANjarPcEb1zSUVEJyO8KlTW1eiTeMrya3cdrqbk3Rhp8XgolRsrv
ZK2rMQxP5nIoHyndtG1CCVqrWnwjIsb4r4cq2aBaUWjQJ+ofpiUHVkHev+h58zEA
zpDZs0Jrv5n7AAAAgQDMU04pqQ1hnv050gs8C2Gy+DjbW8b/NbQl64x0HFik/lWB
CRLrCd341ZQWY0PcU5ZjwNa8GwwJZPJI2bX84/a7dq2ENnT1+uYqpuK8lnPTcBDy
WjlGcf/fWJyJpdLqqXkMZ7or4k9ReVIXz9A8xRkhGEH2xM8Vk2fyoLY88RFUNwAA
AIA+zxdPdF8dPr8HwTJ5Pb0NQjl2likOxR24QmqxlCu/bD1p8R1tZzX5Jh2HP2on
RO+KVLYHzNKqtKRZW/MHftYcm6AvYLhP7hxG/tFoNM9lEmsqdJenxaWP745LP9Pc
k3qh7kC4KfTXyfgsd+C6dXzqhAokz81zL41QtyJxlQzR2w==
Private-MAC: ce79771084cbabf61fc2bf3b1403e42a9957e2af
id_rsa.pub
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20170110"
AAAAB3NzaC1yc2EAAAABJQAAAQEAx0UhtZcgUT5XpoNlcoVFGHbArEsARQVCv5m0
TRh90Xq15gxOvL+x7I0B29xOuOP054RtQaOzHqnKUzpMdrIoZFkYEYJ11p42kC05
PVR/CwtKBuONJZzoIveJlNG1IhbC3G8DMZD5j68T5OVbCqftHMIBe4CTr7TewJ9T
/lmSZPytWXk/Xtcvn1i1TQZS2ShtSNOwtx77fLzkVmC6F4uM2JgJ9bSM2xQZTX/j
DYZTtoEsmyBadANAEZx4kQAoITwxXVRPBPJnB74EdSMXNhrDBJ+sZSEy7kxmc3a/
UK6CzdN3wiEMd/Bb1nuzR2cpWrWhniG66lnOTJb3sF8iiVtw7Q==
---- END SSH2 PUBLIC KEY ----
這裏可能有什麼問題嗎?
我做到了。但是得到了同樣的錯誤。 –
那麼,您可能必須將'id_rsa.pub'移開,因爲客戶端無法讀取它。 – Jakuje
它沒有幫助。我認爲生成的公鑰對於OpenSSH無效。它應該從'ssh-rsa AAAAB3NzaC1yc ...'開始。但我的鑰匙開始時有一些評論,並沒有ssh-rsa的話。 –