Understanding everything about SSH keys

0

consider me as noob, but I've 0 idea about ssh keys, I know ssh is very secure, one thing I know, that you don't need to remember password when you like to access your remote server, now i've 3 remote linux servers and my .ssh folder has files like this

  • server_1.key
  • server_1.pem
  • id_rsa
  • id_rsa.pem
  • id_rsa.pub
  • key
  • known_hosts
  • server_2.key
  • server_2.pem
  • server_3.key
  • server_3.pem

now I've no idea what these files and what is their purpose, one thing i know, i have to add key file to my filezilla so if can use sftp, secondly when i want to access server_1, i've to do ssh .ssh/server_1.key user@server.com which let's me access the server, now problem occurred when I created server_2, I can access via ssh but I'm unable to connect via filezilla to transfer files.

I know if you are system admin / pro in this field this is a very lame question, but being noob I would love if anyone could explain in detail, so i can start managing them correctly.

Things I'm looking in answer

  • what key does what
  • what if I have to format / reinstall new os in my system, which files to save(backup)
  • how is it i'm able to ssh server_2 but unable to access it via filezilla
  • I've have a passphrase in key file, how can I change it
  • What if I want to change server_1.key server_1.pem keys just like we change our password

Would love a details answer, please don't downvote this question, i've googled a lot, this will not only help me but will help future noobs in this field, thank you

posted on stackoverflow

runningmark

Posted 2016-03-31T08:38:28.503

Reputation: 101

Answers

0

  • What key does what

All the keys do authentication. Except known_hosts, which is just a list of known hosts and their public host keys.

  • what if I have to format / reinstall new os in my system, which files to save(backup)

All of them.

  • how is it I'm able to ssh server_2 but unable to access it via filezilla

Probably wrong configuration in FileZilla. You didn't show it to us, so we have no idea to verify what is wrong.

  • I've have a passphrase in key file, how can I change it

From manual page for ssh-keygen:

The passphrase can be changed later by using the -p option."

 ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
  • What if I want to change server_1.key server_1.pem keys just like we change our password

Generate public key from the new one:

 ssh-keygen -y [-f input_keyfile]

and replace the old public key in the server's ~/.ssh/authorized_keys

Jakuje

Posted 2016-03-31T08:38:28.503

Reputation: 7 981