Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### 1.生成公钥
- ```
- ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f ~/.ssh/github_id_rsa
- ```
- #### 2.配置
- 在`config`文件添加配置(没有config文件则新建):
- ```
- # github
- Host github.com
- HostName github.com
- PreferredAuthentications publickey
- IdentityFile ~/.ssh/github_id_rsa
- ```
- ### 3.添加公钥
- 复制`~/.ssh/github_id_rsa.pub`内容在`github`上添加公钥
- ### 3.测试公钥
- ```
- ssh -T git@github.com
- ```
Add Comment
Please, Sign In to add comment