There is a very good question on [How to] SSH to Elastic [an] 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?
To create a file named .ebextensions/authorized_keys.config
is another way to do it.
files:
/home/ec2-user/.ssh/authorized_keys:
mode: "000400"
owner: ec2-user
group: ec2-user
content: |
ssh-rsa AAAB3N...QcGskx keyname
ssh-rsa BBRdt5...LguTtp another-key
The name of file authorized_keys.config
is arbitrary.