创建ssh-key 并且重命名
cd ~/.ssh
ssh-keygen -t rsa -C "example@example.com"
ssh-keygen -t ed25519 -C "your_email@example.com"
on Windows:
eval `ssh-agent -s`
将ssh-key添加到ssh agent
ssh-add example
配置,将不同账号与ssh-key关联
vim config
Host example
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/example
在git服务器上添加公钥
cat example.pub
测试
ssh -T …