标签:id_rsa red key root public conf 保存 添加 用户
多个 ssh key 配置多个网站
ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_one
ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_two
# 不添加-f 参数 会默认将私钥保存在~/.ssh/id_rsa
vim ~/.ssh/config
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_one # 默认使用的是id_rsa
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_two # 默认使用的是id_rsa
Host ubuntu-1
HostName 192.168.0.91
Port 22 # ssh 访问端口
User root # 登陆用户
IdentityFile ~/.ssh/id_rsa
ssh -T git@github.com
ssh -T git@gitee.com
ssh ubuntu-1 # 类似登陆 ssh root@192.168.0.91 -p 22
https://www.cnblogs.com/godfeer/p/12214301.html
标签:id_rsa red key root public conf 保存 添加 用户
原文地址:https://www.cnblogs.com/xiaobaiskill/p/13045347.html