简体   繁体   中英

different ssh login methods

Could you please help me to understand bellow authentication methods

  1. ssh -i PrivateKey.pem ec2-user@52.48.32.12
  2. Password less athentication

As per the my understanding in both above cases we use private key and public key. In both methods pubic keys are stored in ~/.ssh/authorized_keys file in the server which need to login.

  1. In first method user provides corresponding private key. But in second method how authentication mechanism know what is the corresponding private key as user not supply the private key.

  2. Can we arrange pass wordless authentication like ssh -i id_rsa ec2-user@52.48.32.12

  3. Can we use two public keys and two private keys to authenticate to the same server from same client.

In first method user provides corresponding private key. But in second method how authentication mechanism know what is the corresponding private key as user not supply the private key.

The client is using private keys in default location ( ~/.ssh/id_{rsa,dsa,ecdsa,ed25519} ).

Can we arrange pass wordless authentication like ssh -i id_rsa ec2-user@52.48.32.12

Yes, the filename does not matter. But of course it has to be a valid private key.

Can we use two public keys and two private keys to authenticate to the same server from same client.

Yes. But servers are usually fine with accepting single key, so there is no need to do that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM