0 votes
1 view
in AWS by (19.2k 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.6k 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...