Managing two ssh keys

柔情痞子 提交于 2019-12-02 11:29:10

Create a SSH config file

When you have multiple identity files, create a SSH config file mechanisms to create aliases for your various identities.

You can construct a SSH config file using many parameters and different approaches.

The format for the alias entries use in this example is:

Host alias 
  HostName bitbucket.org 
  IdentityFile ~/.ssh/identity

To create a config file for two identities (workid and personalid), you would do the following:

Open a terminal window.
Edit the ~/.ssh/config file. 

If you don't have a config file, create one.
Add an alias for each identity combination for example:

Host workid
HostName bitbucket.org
IdentityFile ~/.ssh/workid

Host personalid
HostName bitbucket.org
IdentityFile ~/.ssh/personalid

PS

Don't forget to load the keys to your github account.

How to add ssh key to github account?

  • Login to github account
  • Click on the rancher on the top right (Settings)

  • Click on the SSH keys

  • Click on the Add ssh key

  • Paste your key and save

And you all set to go :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!