github ssh 鏈接初步

Git SSH Key 生成步驟

  • 一 :設置Git的user name 和email
    • $ git config --global user.name "你的用戶名"
    • $ git config --global user.email "git註冊郵箱"
  • 二 : 生成ssh祕鑰的過程:
  1. 查看是否已經有了ssh密鑰:cd ~/.ssh 若是沒有密鑰則不會有此文件夾,有則備份刪除
  2. 生存密鑰: $ ssh-keygen -t rsa -C "git註冊郵箱" 按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.pubgit

  1. 添加密鑰到ssh:ssh-add 文件名 須要以前輸入密碼。github

  2. 測試:shell

  • $ ssh git@github.com The authenticity of host 'github.com (192.30.252.123)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,192.30.252.123' (RSA) to the list of known hosts. PTY allocation request failed on channel 0 Hi duanqichao1993! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.
相關文章
相關標籤/搜索