0

In all the guides I fond the way to generate, with ssh-keygen the private and the public keys. I think, but not sure, the two keys are related. Continue with the guides, I copy the public key to bitbucket (for example), and I can exchange information between them.

But, what if I want to use two computers?, I already have a key in the repository, I'm not sure if I can use another key, so I tried to download, I can copy the public key, but I don't see the private one in the repo so,

I don't need it?

I should create another?

Should I copy it from the other computer? and what happens If I can't?

I suppose it isn't a problem if

  1. The keys aren't so close related, but I doubt it because they are created with the same command

  2. The way to work with ssh is to have different keys for different computers.

Note: I'm using ubuntu

Stephen Ostermiller
  • 21,408
  • 12
  • 81
  • 104
  • The private key should not be shared with anyone else, but copying it between your own computers is fine. The public key, as the name says, is public and doesn't contain any secrets, but it allows someone to check whether you are in possession of the secret private key. – tripleee Jan 22 '22 at 10:43
  • Another mechanism is to have different keys on the two computers, and upload both their public keys to your Bitbucket profile. – tripleee Jan 22 '22 at 10:45
  • This is almost certainly a duplicate of an existing question, so not posting an answer. Going forward, please search before asking. – tripleee Jan 22 '22 at 10:46
  • Those answers have good points in some aspects, but do not answer is there is a relation between public an private keys, or if I can only use the public key in the new computer, or, in general, how it works. – user13182570 Jan 22 '22 at 11:34
  • But then that's a general computing topic and as such not suitable for Stack Overflow (though I'm sure you could find existing questions here about that, too). – tripleee Jan 22 '22 at 11:42
  • Something like this? https://stackoverflow.com/questions/3828823/how-to-generate-ssh-keys-for-github – tripleee Jan 22 '22 at 11:46

0 Answers0