码迷,mamicode.com
首页 > 其他好文 > 详细

Git SSH Key 生成步骤

时间:2017-09-12 23:04:15      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:添加   文件   ssh   查看   配置   设置   mail   输入   步骤   

Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置。

github的SSH配置如下:

一 、

设置Git的user name和email:

$ git config --global user.name "your-name"

$ git config --global user.email "your-email"

 

二、生成SSH密钥过程:

1.查看是否已经有了ssh密钥:cd ~/.ssh

如果没有密钥则不会有此文件夹,有则备份删除

2.生存密钥:

$ ssh-keygen -t rsa -C “haiyan.xu.vip@gmail.com”

按3个回车,密码为空。

 

Your identification has been saved in /home/tekkub/.ssh/id_rsa.

Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.

The key fingerprint is:

………………

 

最后得到了两个文件:id_rsa和id_rsa.pub

 

3.添加密钥到ssh:ssh-add 文件名

需要之前输入密码。

4.在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥。

 

源文档 <http://blog.csdn.net/hustpzb/article/details/8230454/

Git SSH Key 生成步骤

标签:添加   文件   ssh   查看   配置   设置   mail   输入   步骤   

原文地址:http://www.cnblogs.com/jwentest/p/7512488.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!