Guest User

Untitled

a guest
Dec 10th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #### 1.生成公钥
  2. ```
  3. ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f ~/.ssh/github_id_rsa
  4. ```
  5. #### 2.配置
  6. 在`config`文件添加配置(没有config文件则新建):
  7. ```
  8. # github
  9. Host github.com
  10. HostName github.com
  11. PreferredAuthentications publickey
  12. IdentityFile ~/.ssh/github_id_rsa
  13. ```
  14. ### 3.添加公钥
  15. 复制`~/.ssh/github_id_rsa.pub`内容在`github`上添加公钥
  16. ### 3.测试公钥
  17. ```
  18. ssh -T git@github.com
  19. ```
Add Comment
Please, Sign In to add comment