Public-key cryptography secures SSH access with two mathematically related keys: keep the private key secret on your machine and place the matching public key on the server. The server verifies your identity without seeing the private key, helping keep the connection authenticated and encrypted. section 12.3.6
Creating an SSH key pair
During Elastic Beanstalk initialization, choose SSH setup, name the key pair, and optionally enter a passphrase. The EB CLI generates the pair locally and uploads only the public key to EC2. AWS later checks that you possess the private key before allowing access.




