Can I use my ssh keypair from a different machine
I created a ssh key-pair and published the key as part开发者_StackOverflow of my github account. Now I would like to access my account from a different machine (say an EC2 instance), so I copied my ~/.ssh/id_rsa* files into the target machine and was able to checkout code.
Is this an acceptable procedure or should I generate a different key pair on that machine and also publishing that key into my github account.
Yes you can use the same key. If you are the only developer and do not require any audit logging, then it really does not matter.
If you are working as apart of a team, issuing multiple keys makes it easy to revoke access when that is necessary and move team members from one project to another.
However, in your instance, can you use the same ssh keypair?.. Yes you can.
Also -> Do you control who has access to each machine?
As a side note however, I am the only developer on a particular project, but on this project I have worked from about six different sites. For each of these sites, I have used a different key. I have done this so that I can easily revoke access when I was working from a different office. So that is one instance where even though I am a sole developer, and did not require any logs, I still used multiple keys. (I don't work just from location and I can't control who has access to the machines which have the keys.).
In my opinion, the key identifies the user, not the machine the user was working on.
So, the answer is: yes, it's not just ok to copy the key: it's the only clean solution.
What would you gain if you create one key for every box you're working on? The only effect I can see is that you have to manage a bunch of certificates that all identify the same person. That's not quite desirable.
The way you use your key has nothing got to do with whether you are the only developer of the project or not. If you have a hundred users, each of them would have one key identifying them. And they would use that one key on every machine they are working on.
精彩评论