Mac下配置多個SSH Keys

Mac下配置多個SSH Keys

生成SSH key

# Creates a new ssh key using the provided email
# 默認生成的文件名爲id_rsa,能夠根據命令提示自行修改
ssh-keygen -t rsa -C "name@email.com"

查看SSH key

cat ~/.ssh/id_rsa.pub

設置配置文件

# code.dianpingoa.com
Host code.workdomain.com
HostName code.workdomain.com
User name1@email.com
PreferredAuthentications publickey
IdentityFile /Users/dawn/.ssh/id_rsa#對應SSH key文件名

# git.dinpingoa.com
Host github.com
HostName github.com
User name2@email.com
PreferredAuthentications publickey
IdentityFile /Users/dawn/.ssh/id_rsa_mt#對應SSH key文件名
相關文章
相關標籤/搜索