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.
相关文章
相关标签/搜索