3

I need help on exporting both private keys and public located in ssh into one file. id_rsa and id_rsa.pub

Braiam
  • 69,112
noxmart
  • 31

1 Answers1

6

You can restore a public key from the private key file with ssh-keygen.

ssh-keygen -y -f /path/to/private/key

Saving both keys in the same file is not neccessary and not supported. You could however simply use cat to combine them for archiving purposes or whatever you're planning.

cat id_rsa id_rsa.pub > combined

However this keyfile will not be readable by ssh in the way you may think it is. To restore these key files, you will have to split them up and save them in seperate files again.

bkzland
  • 806