MacOS下Github添加ssh key的步骤

作者: ZYiDa | 来源:发表于2017-10-31 10:43 被阅读292次

打开终端
输入:
ssh-keygen -t rsa -C "xxx@xx.com"

回车,出现如下提示:

Last login: Tue Oct 31 10:20:24 on ttys004
bogon:~ YYKit$ ssh-keygen -t rsa -C "xxx@xxx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xx/.ssh/id_rsa): 

继续回车,中间会让输入两次密码,什么都不输入,继续回车,会出现如下内容:

Last login: Tue Oct 31 10:20:24 on ttys004
bogon:~ YYKit$ ssh-keygen -t rsa -C "xxxx@xxx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xx/.ssh/id_rsa): 
/Users/xx/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/xx/.ssh/id_rsa.
Your public key has been saved in /Users/xx/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:rp+6MLo27uTIONMqlO6/E9d9CvJzvVt5QI9I6Z2vy14 468466882@qq.com
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|            .    |
|           o .   |
|          o + +  |
|  .   . S  o = . |
| o . o + . .  +  |
|o.. = o o +  o E |
|*=+o o + + .o +  |
|*XB=o ++=  o+=.  |
+----[SHA256]-----+
bogon:~ YYKit$ 

这时候,复制/Users/xxx/.ssh/id_rsa.pub.,然后前往文件夹,

屏幕快照 2017-10-31 上午10.33.30.png

打开id_rsa.pub,复制"xxx@xx.com"之前的部分。

这时候,来到Github,在你的个人账户中,按照顺序依次点击“Settings --> SSH and GPG keys --> SSH keys --> New SSH Key”,Title可以写自己喜欢的标记,在Key下面粘贴之前复制的内容,然后点击Add SSH Key,之后可能会让你输入账户密码进行验证,这就就添加成功了。

相关文章

  • MacOS下Github添加ssh key的步骤

    打开终端输入:ssh-keygen -t rsa -C "xxx@xx.com" 回车,出现如下提示: 继续回车,...

  • windows开始使用git

    添加 ssh key 在 github 上添加 SSH key 的步骤: 1、首先需要检查你电脑是否已经有 SSH...

  • (搬运)Git SSH Key 生成并添加到 Github 步骤

    Git SSH Key 生成并添加到 Github 步骤 原文:Git SSH Key 生成步骤 Git 是分布式...

  • gitlab 免密操作

    在 github 上添加 SSH key 的步骤: 1、首先需要检查你电脑是否已经有 SSH key 运行 git...

  • Github使用笔记

    一、配置Github环境 安装Git 配置ssh-key 检查ssh-key的设置 生成新ssh-key 添加ss...

  • Github添加SSH key

    很多朋友在用github管理项目的时候,都是直接使用https url克隆到本地,当然也有有些人使用 SSH ur...

  • Github添加SSH Key

    原CSDN地址http://blog.csdn.net/byhook/article/details/501360...

  • github添加ssh key

    1,登录github在右上角有一个setting,选择SSH and GPG keys选项, New SSH ke...

  • 与远程版本库协作

    生成 SSH Key 想要在 GitHub 提交代码必须要先添加 SSH Key 配置。 指定 rsa 算法生成密...

  • github设置添加SSH

    github设置添加SSH 为什么GitHub需要SSH Key呢?因为GitHub需要识别出你推送的提交确实是你...

网友评论

    本文标题:MacOS下Github添加ssh key的步骤

    本文链接:https://www.haomeiwen.com/subject/yynvpxtx.html