Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a private key git file in my desktop wich I currently use and I also need to use on my laptop, my question is can I also use the same key in a different computer and if its possible how can I do it ??

I'm using tortoise git.

Cheers

share|improve this question

migrated from stackoverflow.com Aug 4 '10 at 13:52

This question came from our site for professional and enthusiast programmers.

    
not a programming question. ask superuser.com –  Scharron Aug 3 '10 at 13:44
add comment

2 Answers

You can, but you absolutely should not ever copy private keys between computers. Once it is transmitted over a network, you cannot be sure that it is kept secure. Moreover, private keys were not designed to be used this way. A private key represents an account on a specific device, not a user in general.

The best practice is to generate a new private key for every user/machine combination you wish to use. (You can use the same passphrase in each case, if desired, because the private key will still come out differently, but for extra security you should use a different phrase. You can embed the user/machine name in the phrase to help you remember, if this becomes an issue.)

share|improve this answer
add comment

You can. I share the same private key across several laptops. All you have to do is copy the id_rsa and id_rsa.pub from ~/.ssh on the current machine to the same directory on the target machine. The latter contains the public key, but you'll probably want that available on both machines for access later. It's probably not strictly necessary to answer your question.

share|improve this answer
1  
NO! Don't do this! –  Ether Aug 3 '10 at 16:03
    
Talk about security risk :D –  sleepynate Aug 3 '10 at 17:18
    
Never said it was a good idea. I understand the risks, but there was a time when one of the services I used--Github or Unfuddle, I think--only allowed access from one key. That made it a necessary evil for me when I did it. Though, to this point, I haven't changed it so that's on me. –  Rob Wilkerson Aug 3 '10 at 17:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.