I've reading about asymmetric cryptography and I know that the concept is to keep the private key to yourself and distribute the public key. But recently I accessed a remote server using SSH with a .pem file. The command I used to access was
ssh -i ./key/private_key.pem -l comp <ip_address>
I checked the manual page for ssh and it says
-i identity_file
Selects a file from which the identity (private key) for public key authentication is read.
I wonder why I was given a file with private key, how was I authenticated, and what did the server have?
-iis actually my own private key(and created on my PC) and the server already had my public key(which also was generated on my PC along with the private key)? Because, what I had in my mind till now was that I'm using server's private key with-i. – 7_R3X Sep 07 '16 at 19:27