CentOS 7 生成SSH連接GitHub的SSH-key

  1. 生成秘鑰
//換成你自己的郵箱
ssh-keygen -t rsa -C "343672271@qq.com"
//一直next并記住生成的地址
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
  1. 進入.ssh 目錄提出key
[root@localhost ~]# cd .ssh
[root@localhost .ssh]# ls
id_rsa  id_rsa.pub
//把顯示的內(nèi)容復制到GitHub的SSHkey配置即可
[root@localhost .ssh]# cat id_rsa.pub
  1. 測試
[root@localhost .ssh]# ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.113)' 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)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
Hi megoc! You've successfully authenticated, but GitHub does not provide shell access.
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

  • 一、檢查SSH key是否存在 在終端輸入: ls -al ~/.ssh 如果沒有,終端顯示如下: No such...
    JackieWillen閱讀 1,619評論 0 0
  • 背景 公司最近將代碼由svn遷移到了gitlab來托管,我個人平時也經(jīng)常使用Github,可是公司郵箱與我的Git...
    洛城夜雨閱讀 2,067評論 0 5
  • 如何生成SSH key 本文載于Gevin的博客 原文地址:http://blog.igevin.info/pos...
    蕭玄辭閱讀 790評論 0 0
  • 前言: 自己作死下載了多個破解軟件,不知道那個可能程序有問題,導致了電腦重啟后無法開機,苦逼的只能重裝系統(tǒng),所以之...
    Eugene_iOS閱讀 15,996評論 3 10
  • 轉(zhuǎn)自別處: SSH key提供了一種與GitHub通信的方式,通過這種方式,能夠在不輸入密碼的情況下,將GitHu...
    Ten_Minutes閱讀 757評論 0 3

友情鏈接更多精彩內(nèi)容