git + assembla + multiple ssh keys/multiple computers

前端 未结 1 2018
情歌与酒
情歌与酒 2020-12-18 06:58

I have multiple computers working on the same project, and I\'m using a free assembla git repo account to manage all this.

In order to access the git repo, I need t

相关标签:
1条回答
  • 2020-12-18 07:26

    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.

    0 讨论(0)
提交回复
热议问题