GitHub SSH key
GitHub SSH key
https://help.github.com/en/github/authenticating-to-github
steps
HTTPS clone !== SSH clone
https clone bug
SSH clone OK
testing
step 0. Checking for existing SSH keys
check
$ ls -al ~/.ssh
# id_rsa.pub
# id_ecdsa.pub
# id_ed25519.pub
$ cat ~/.ssh/id_rsa.pub
$ cat ~/.ssh/id_rsa
https://help.github.com/en/github/authenticating-to-github/checking-for-existing-ssh-keys
step 1. Generating a new SSH key
create
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
step 2.
add
https://github.com/settings/ssh/new
step .3
将 SSH 密钥添加到 ssh-agent
zh-Hans
$ eval "$(ssh-agent -s)"
# 修改 ~/.ssh/config 文件以自动将密钥加载到 ssh-agent 中并在密钥链中存储密码。
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
$ ssh-add -K ~/.ssh/id_rsa
step 4.test
$ ssh -T git@github.com
OK 👌
GPG key
https://help.github.com/articles/generating-a-gpg-key/
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12577961.html
未经授权禁止转载,违者必究!