github生成个公钥
2015-06-17 14:23
330 查看
1 如果没有安装ssh,那么使用下面的指令 sudo apt-get install ssh 2 检查SSH公钥 cd ~/.ssh 看看存不存在.ssh,如果存在的话,掠过下一步;不存在的请看下一步 3 生成SSH公钥 $ ssh-keygen -t rsa -C "your_email@youremail.com" # Creates a new ssh key using the provided email Generating public/private rsa key pair. Enter file in which to save the key (/home/you/.ssh/id_rsa): 现在你可以看到,在自己的目录下,有一个.ssh目录,说明成功了 3.1 输入github密码 Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again] 这个时候输入你在github上设置的密码。 3.2 然后在.ssh中可以看到 Your identification has been saved in /home/you/.ssh/id_rsa. # Your public key has been saved in /home/you/.ssh/id_rsa.pub. # The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@youremail.com 4 添加SSH公钥到github 打开github,找到账户里面添加SSH,把idrsa.pub内容复制到key里面。 5 测试是否生效 使用下面的命令测试 ssh -T git@github.com 当你看到这些内容放入时候,直接yes The authenticity of host 'github.com (207.97.227.239)' 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)? 看到这个内容放入时候,说明就成功了。 Hi username! You've successfully authenticated, but GitHub does not provide shell access.
相关文章推荐
- Go视频教程整理
- C语言sscanf的用法总汇
- Struts2框架实现简单的用户登入
- PHP高效率写法
- 编程随记
- java对象的强引用,软引用,弱引用和虚引用
- PHP中比较两个时间的大小与日期的差值
- Spring+mabatis配置文件
- 第3章 Java的基本程序设计结构
- ElasticSearch:堆大小与swap设置
- springMVC 4.0 集成 quartz 2.2实例
- LeetCode 200. Number of Islands
- javamail中使用一些问题的解决方案
- Java: 在不同windows主题下,JFrame窗口设置最佳高度的解决方案
- 方块滚动代码
- java: 关于从jar中读取资源遇到的问题getClass().getResource(...)
- java锁的理解
- C++11 标准新特性: 右值引用与转移语义
- 关于qt学习的一点小记录(2)
- Quartz1.7 动态添加、修改和删除定时任务(非spring集成版)