美文网首页
如何设置Github SSH key

如何设置Github SSH key

作者: _TheSpecialOne | 来源:发表于2019-04-06 00:14 被阅读0次

Github 为我们提供了 Desktop App 用于我们本地和GitHub上的Repository交互,但作为码农,
在黑乎乎的shell中用命令似乎更有黑客感,显得更有技术含量。

如何生成 SSH
  • 首先查看.ssh 目录

我们的目标是生成id_dsa.pub, 如果你从未生成过,查看之后应该是这样的

$ cd ~/.ssh
$ ls
known_hosts

或者

$ cd ~/.ssh
$ ls
authorized_keys2  id_dsa       known_hosts
config            id_dsa.pub
  • 使用神奇的 ssh-keygen
$ ssh-keygen -o
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mac/.ssh/id_rsa):
Created directory '/home/mac/.ssh'.
Enter passphrase (empty for no passphrase):  #可以直接按回车
Enter same passphrase again: #可以直接按回车
Your identification has been saved in /home/schacon/.ssh/id_rsa.
Your public key has been saved in /home/schacon/.ssh/id_rsa.pub.
The key fingerprint is:
d0:82:24:8e:d7:f1:bb:9b:33:53:96:93:49:da:9b:e3 schacon@mylaptop.local
  • 查看我们生成的SSH
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En
mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx
NrRFi9wrf+M7Q== schacon@mylaptop.local

  • Github设置SSH

    image.png
  • 试着在Github上clone repository

➜  0.Github git clone git@github.com:pizzaql/pizzaql.git
Cloning into 'pizzaql'...
Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.
remote: Enumerating objects: 40, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (24/24), done.
Receiving objects:  16% (189/1181), 28.01 KiB | 7.00 KiB/s
  • 大功告成

THE END

相关文章

  • GitHub 的设置

    2. 为 GitHub 账号设置 SSH Key 为-GitHub-账号设置-SSH-Key) 出于安全考虑,Gi...

  • 如何设置Github SSH key

    Github 为我们提供了 Desktop App 用于我们本地和GitHub上的Repository交互,但作为...

  • Github使用笔记

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

  • github SSH key 设置

    生成SSH密钥过程: 1.查看是否已经有了ssh密钥:cd ~/.ssh如果没有密钥则不会有此文件夹,有则备份删除...

  • Github SSH Key设置

    1.Github注册 [http://www.github.com] 2.配置本地Git(mac) 生成SSHKe...

  • Github 设置 SSH Key

  • 本地Git关联多个Github账号 & SSH Config

    注:假设读者知道如何关联ssh key到Github账号。 场景 多个Github账号 希望通过ssh key关联...

  • github-如何设置SSH Key

    设置SSH Key 在注册好github账号后,打开你的电脑桌面上的一个文件夹,这就建立了一个本地工作库,在里面点...

  • github设置添加SSH

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

  • git入门

    一.设置SSH Key(每个设备只有一个) 1.进入https://github.com/settings/key...

网友评论

      本文标题:如何设置Github SSH key

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