Search code examples
macossshraspbian

should I overwrite existing ssh key


I was going to add ssh key for the machine I ssh so I do not have to enter password every time, but when I hit ssh-keygen I got this prompt

Enter file in which to save the key (/Users/sanjeevkumar/.ssh/id_rsa): I decided to accept I thought it will create new file mentioned in parentheses, but I got message saying /Users/sanjeevkumar/.ssh/id_rsa already exists. Overwrite (y/n)?

now I am little cautious that where did the existing file come from and for what the existing file is storing the key for.

If I choose to overwrite I don't want to be in situation where there tools stop working !


Solution

  • If you're not sure if you're already using that SSH Key for anything, you should make a back-up copy and then overwrite the key in order to check if anything is broken. (And if it is, just restore this back-up)

    Other thing you could do is using your current key as your main one for this other machine.