本地按照github 提示 和 云效提示,生成密钥
云效:ssh-keygen -t ed25519 -C “your_email@example.com”
github:ssh-keygen -t rsa -C ‘XXX@XXX’
参考:https://help.aliyun.com/document_detail/153709.html
C:\Users\xxxx.ssh
新增无后缀config文件
Host github.com
HostName github.com
User xxx@xxx.com
PreferredAuthentications publickey
IdentityFile C:\Users\xxx\.ssh\id_rsa
Host codeup.aliyun.com
HostName codeup.aliyun.com
User yyy@yyy.com
PreferredAuthentications publickey
IdentityFile C:\Users\xxx\.ssh\id_ed25519
验证是否连接成功
ssh -T git@github.com
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
输入yes
最终会得到:You’ve successfully authenticated
ssh -T git@codeup.aliyun.com
会显示:Welcome to Codeup
参考文档:https://baijiahao.baidu.com/s?id=1667080409461835667&wfr=spider&for=pc