Which of the following is used as a secure way to log into an EC2 Linux Instance?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: B.
Option A is incorrect because the IAM username and password are used for logging in to the AWS console and cannot log in to EC2 instances.
Option B is CORRECT because Key pairs consist of a public key and a private key.
You use the private key to create a digital signature, and then AWS uses the corresponding public key to validate the signature.
Key pairs can be used to SSH to Amazon EC2 instances.
Option C is incorrect because AWS Access Keys are used for logging in to the AWS console & services using the command line.
They cannot be used to log in to EC2 instances.
Option D is incorrect because AWS SDK provides APIs for AWS services.
It cannot be used to log in to EC2 instances.
For more information on AWS Security credentials, please visit the below URL:
https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.htmlThe most secure way to log into an EC2 Linux instance is by using key pairs.
Key pairs are a set of public and private keys that are generated by the user and stored separately on the local computer and the remote instance. The private key is kept securely on the user's computer and is used to authenticate the user when logging into the instance. The public key is stored on the remote instance and is used to verify the authenticity of the user's private key.
To use key pairs to log into an EC2 Linux instance, the user must first generate a key pair using a tool such as ssh-keygen. The public key is then uploaded to the instance when it is launched, or it can be added later by updating the instance's authorized keys file. The private key is used to authenticate the user when logging into the instance using a tool such as SSH.
Using IAM User name and password is not recommended for logging into an EC2 Linux instance as this involves sharing the user's AWS credentials with the instance. This can be a security risk as it can allow anyone with access to the instance to potentially gain access to the user's AWS account.
AWS Access keys and SDK keys are also not recommended for logging into an EC2 Linux instance as they are designed for programmatic access to AWS resources and do not provide a secure way to log into an instance.