简体   繁体   English

不同的ssh登录方法

[英]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.在这两种方法中,公钥都存储在需要登录的服务器中的~/.ssh/authorized_keys文件中。

  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我们可以安排像ssh -i id_rsa ec2-user@52.48.32.12这样的ssh -i id_rsa ec2-user@52.48.32.12认证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} ).客户端在默认位置使用私钥 ( ~/.ssh/id_{rsa,dsa,ecdsa,ed25519} )。

Can we arrange pass wordless authentication like ssh -i id_rsa ec2-user@52.48.32.12我们可以安排像 ssh -i id_rsa ec2-user@52.48.32.12 这样的 passless 认证吗

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.但是服务器通常可以接受单个密钥,因此没有必要这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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