git + assembla + multiple ssh keys/multiple computers

*爱你&永不变心* 提交于 2019-11-29 07:36:10
VonC

You can create as many public/private ssh key as you want.
Simply don't use the default names id_rsa and id_rsa.pub.

However, not using the default naming convention means ssh, by default, won't find your keys.
You need to define in your ~/.ssh directory a config file, where you will indicate what private key to use:

Host myproject1
    HostName server1
    IdentityFile ~/.ssh/project1.rsa
    User username

You can then push to myproject1 if you have added myproject1 as a remote.
See also "Unable to Git-push master to Github" for ssh troubleshooting, and "Specify an SSH key for git push without using ~/.ssh/config" for adding your ssh address as a remote.

You can add to the ~/.ssh/config file as many address as you need, each one referring a private key that you can name as you want.

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