博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决git clone提示Permission denied publickey 问题
阅读量:4029 次
发布时间:2019-05-24

本文共 1824 字,大约阅读时间需要 6 分钟。

http://bbs.gsmcn.cn/thread-2474-1-1.html 


偶然编译中文recovery时候遇到了一个错误.后来尝试了一下.解决了,在这里记录分享一下


root@htcdev-VirtualBox:~/Rec_folder# git clone :APAR1992/CWM_Recovery_v6037_cn.git
Cloning into 'CWM_Recovery_v6037_cn'...
The authenticity of host 'github.com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
root@htcdev-VirtualBox:~/Rec_folder# 

报错看来是跟publickey有关系
首先来github的解决中心来看 跟着教程走


  1. root@htcdev-VirtualBox:~# cd ~/.ssh
  2. root@htcdev-VirtualBox:~/.ssh# ls
  3. known_hosts
  4. root@htcdev-VirtualBox:~/.ssh# ssh-keygen -t rsa -C recovery@gsmcn.cn  
  5. Generating public/private rsa key pair.
  6. Enter file in which to save the key (/root/.ssh/id_rsa): 
  7. Enter passphrase (empty for no passphrase): 
  8. Enter same passphrase again: 
  9. Your identification has been saved in /root/.ssh/id_rsa.
  10. Your public key has been saved in /root/.ssh/id_rsa.pub.
  11. The key fingerprint is:
  12. 0b:3a:6d:6e:63:e5:6c:a1:1e:1d:c0:61:73:60:5d:d9 recovery@gsmcn.cn
  13. The key's randomart image is:
  14. +--[ RSA 2048]----+
  15. |      *o...o     |
  16. |     + +. . E    |
  17. |      o          |
  18. |       .         |
  19. |      . S        |
  20. |     o ooo       |
  21. |    o +=o.       |
  22. |     +=.+        |
  23. |     +oo         |
  24. +-----------------+
  25. root@htcdev-VirtualBox:~/.ssh# 
复制代码
这里ssh-keygen -t rsa -C "Your@Your.com" 替换为你的邮箱地址,别的都为空,直接回车,就会提示你生成完毕



紧接着执行
  1. ssh-add id_rsa
复制代码
然后系统会提示你
  1. root@htcdev-VirtualBox:~/.ssh# ssh-add id_rsa
  2. Identity added: id_rsa (id_rsa)
复制代码




然后我们去github保存你的ssh key
登录github.com --AccountSetting--ssh  点击Add
然后输入我们刚才计算的key

这里有个简单的复制方法 打开终端 输入
  1. sudo apt-get install xclip
复制代码

然后执行
  1. xclip -sel clip < ~/.ssh/id_rsa.pub
复制代码

直接在key那里右键粘贴 Title随意写。。。



到这里 我们的ssh key 就算添加完毕了
现在去同步下代码看看,终于可以同步了!~




测试环境 ubuntu12.04
 

转载地址:http://xrobi.baihongyu.com/

你可能感兴趣的文章
coursesa课程 Python 3 programming 输出每一行句子的第三个单词
查看>>
coursesa课程 Python 3 programming Dictionary methods 字典的方法
查看>>
Returning a value from a function
查看>>
coursesa课程 Python 3 programming Functions can call other functions 函数调用另一个函数
查看>>
coursesa课程 Python 3 programming Tuple Assignment with Unpacking
查看>>
coursesa课程 Python 3 programming The while Statement
查看>>
course_2_assessment_6
查看>>
coursesa课程 Python 3 programming course_2_assessment_7 多参数函数练习题
查看>>
coursesa课程 Python 3 programming course_2_assessment_8 sorted练习题
查看>>
visca接口转RS-232C接口线序
查看>>
在unity中建立最小的shader(Minimal Shader)
查看>>
1.3 Debugging of Shaders (调试着色器)
查看>>
关于phpcms中模块_tag.class.php中的pc_tag()方法的含义
查看>>
vsftp 配置具有匿名登录也有系统用户登录,系统用户有管理权限,匿名只有下载权限。
查看>>
linux安装usb wifi接收器
查看>>
关于共享单车定位不准问题
查看>>
终于搞定CString和string之间转换的问题了
查看>>
用防火墙自动拦截攻击IP
查看>>
补充自动屏蔽攻击ip
查看>>
谷歌走了
查看>>