What is the difference between the .pem and .pub and non suffixed ssh credentials files?

Solution 1:

.pub file format is used by SSH for public key store, this key need to share with a Server.

.pem(Privacy Enhanced Mail) is a base64 container format for encoding keys and certificates. .pem download from AWS when you created your key-pair. This is only a one time download and you cannot download it again.

.ppk(Putty Private Key) is a windows ssh client, it does not support .pem format. Hence you have to convert it to .ppk format using PuTTyGen.

non suffixed ssh file is a private key


Convert PEM to PPK file format

puttygen server.pem -O private -o server.ppk

Create a PEM from a PPK file

puttygen server.ppk -O private-openssh -o server.pem  

Solution 2:

In SSH connections, keys are exchanged.

key1 is the private key and key.pub is the public key.

Read more at: Public-key cryptography

The .pem files are certificates (in base64), exchanged in HTTPS protocol (TLS/SSL). Read more at: X.509