生成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文件名

相关文章:

  • 2021-06-25
  • 2021-09-10
  • 2021-11-15
  • 2021-12-20
  • 2021-05-14
  • 2021-12-26
  • 2022-12-23
猜你喜欢
  • 2021-07-10
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案