How to add multiple keys for elastic beanstalk instance?

前端 未结 8 1372
青春惊慌失措
青春惊慌失措 2020-12-23 17:05

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 ke

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-23 17:18

    Following on from Jim Flanagan's answer, you could get the keys added to every instance by creating .ebextensions/app.config in your application source directory with contents:

    commands:
      copy_ssh_key_userA: 
        command: echo "ssh-rsa AAAB3N...QcGskx userA" >> /home/ec2-user/.ssh/authorized_keys
      copy_ssh_key_userB: 
        command: echo "ssh-rsa BBRdt5...LguTtp userB" >> /home/ec2-user/.ssh/authorized_keys
    

提交回复
热议问题