到 ~/.ssh
目录下
$ ssh-keygen -t rsa -C "3443386329@qq.com" -f "id_rsa_gitee_ytdl"
$ pbcopy < ~/.ssh/id_rsa_gitee_ytdl.pub
github
或 gitee
设置中ssh -T git@gitee.com
如果连接正常会出现
Hi XX! You've successfully authenticated, but GITEE.COM does not provide shell access.
如果不成功 , 添加rsa
到信任列表
ssh-add -K ~/.ssh/id_rsa_gitee_ytdl
config
文件中配置多个 ssh-key
$open ~/.ssh/
#公司
Host company.gitee.com
Hostname gitee.com
IdentityFile ~/.ssh/id_rsa
User company
#个人
Host me.gitee.com
Hostname gitee.com
IdentityFile ~/.ssh/id_rsa_personal
User me