Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

There is a very good question on SSH to Elastic Beanstalk instance, but one thing I noticed is that, through this method, it is only possible to add one SSH key.

How can I add multiple SSH keys to an instance? Is there a way to automatically add multiple keys to new instances?

1 Answer

0 votes
by (44.4k points)

The answer is NO. Elastic Beanstalk only supports a single key pair. But you can manually add ssh keys to authorized_keys file, but the keys which are added will not be known or access by Elastic Beanstalk tools.

You can create a file named .ebextensions/authorized_key.config is also a way to do it.

files:

  /home/ec2-user/.ssh/authorized_keys:

    mode: "000400"

    owner: ec2-user

    group: ec2-user

    content: |

      ssh-rsa AAAB3N...QcGskx key_name

      ssh-rsa BBRdt5...LguTtp another_key

The name of file authorized_keys.config is arbitrary.

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...