综合开发_github的SSH的生成
来源:互联网 发布:java中获取input标签 编辑:程序博客网 时间:2024/06/05 16:33
如何生成SSH key
SSH key提供了一种与GitHub通信的方式,通过这种方式,能够在不输入密码的情况下,将GitHub作为自己的remote端服务器,进行版本控制
步骤
- 检查SSH keys是否存在
- 生成新的ssh key
- 将ssh key添加到GitHub中
1. 检查SSH keys是否存在
输入下面的命令,如果有文件id_rsa.pub
或 id_dsa.pub
,则直接进入步骤3将SSH key添加到GitHub中,否则进入第二步生成SSH key
ls -al ~/.ssh# Lists the files in your .ssh directory, if they exist
2. 生成新的ssh key
第一步:生成public/private rsa key pair
在命令行中输入ssh-keygen -t rsa -C "your_email@example.com"
默认会在相应路径下(/your_home_path)生成id_rsa
和id_rsa.pub
两个文件,如下面代码所示
ssh-keygen -t rsa -C "your_email@example.com"
#注意“ssh-keygen”之间没有空格# Creates a new ssh key using the provided emailGenerating public/private rsa key pair.Enter file in which to save the key (/your_home_path/.ssh/id_rsa):
第二步:输入passphrase(本步骤可以跳过)
设置passphrase后,进行版本控制时,每次与GitHub通信都会要求输入passphrase,以避免某些“失误”
Enter passphrase (empty for no passphrase): [Type a passphrase]Enter same passphrase again: [Type passphrase again]
sample result:
Your identification has been saved in /your_home_path/.ssh/id_rsa.Your public key has been saved in /your_home_path/.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@example.com
第三步:将新生成的key添加到ssh-agent中(本步骤也可以跳过):
# start the ssh-agent in the backgroundeval "$(ssh-agent -s)"Agent pid 59566ssh-add ~/.ssh/id_rsa
第四步:显示public key:
cat ~/.ssh/id_rsa.pub
3. 将ssh key添加到GitHub中(也可以直接复制)
用自己喜欢的文本编辑器打开id_rsa.pub
文件,里面的信息即为SSH key,将这些信息复制到GitHub的Add SSH key
页面即可
不同的操作系统,均有一些命令,直接将SSH key从文件拷贝到粘贴板中,如下:
mac
pbcopy < ~/.ssh/id_rsa.pub# Copies the contents of the id_rsa.pub file to your clipboard
windows
clip < ~/.ssh/id_rsa.pub# Copies the contents of the id_rsa.pub file to your clipboard
linux
sudo apt-get install xclip# Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)xclip -sel clip < ~/.ssh/id_rsa.pub# Copies the contents of the id_rsa.pub file to your clipboard
0 0
- 综合开发_github的SSH的生成
- Altera 综合开发平台 quartus的开发流程
- ssh密钥的生成
- [github 教程]手把手教你最简单的开源项目托管GitHub入门教程_github 教程
- Mac上SSH的生成
- 生成github的 ssh key
- Git ssh key的生成
- 生成 SSH Key的步骤
- 关于Git 的 SSH 的生成
- CentOS 7 生成SSH连接GitHub的SSH-key
- web前端之锋利的jQuery十一:综合开发,编写购物网首页
- ssh git key 的生成与覆盖
- 服务器上的 Git - 生成 SSH 公钥
- 服务器上的 Git - 生成 SSH 公钥
- 关于生成Github的SSH密钥
- git生成SSH keys遇到的问题
- 服务器上的 Git - 生成 SSH 公钥
- github与bitbuckut的 ssh生成
- MFC、C++ windows多线程编程
- PG12864F仿真电路和汇编程序演示(8051)
- 数组创建Eigen矩阵
- 将url 进行md5加密 转成字符串 参考 百度知道
- 程序员的性格真的内向吗?
- 综合开发_github的SSH的生成
- 自定义Dialog实现各种效果
- grep 正则表达式说明
- HDU 1014 Uniform Generator GCD水题
- 市场急需的前端工程师基本技能
- SQL Server 根据分隔符依次截取每个子字符串
- struct和class的区别 观察者模式 https连接 点击button收到点击事件,中间发生了什么?4道过滤菜鸟的iOS面试题
- 四元素姿态解算 ---地磁计融合解读
- tornado 12、生产模式部署到服务器过程中遇到的一些命令