chrisrzhou/RShiny-EC2Bootstrap

EC2 key pairs can be reused on multiple EC2 instances (on the same AWS account)

ekuns opened this issue · 2 comments

Very nice guide by the way! One nitpick. You say:

(Note that only one EC2 key can be registered to one machine.)

My experience is that a key can be used on multiple EC2 instances as long as they are on the same AWS account. I've used it that way before, a pool of Linux servers on a single AWS account all using the same key pair for access.

Also, you may also wish to include steps for how to configure SSH so that you can quickly and easily get to a VM without having to provide a path to the key file on the command line. For example, if you copy your key file to ~/.ssh/aws-shiny.pem and then create the following in ~/.ssh/config:

Host *
    ServerAliveInterval 240

Host aws-shiny
    HostName public_dns_name
    User ubuntu
    IdentityFile ~/.ssh/aws-shiny.pem
    ForwardX11 yes
    ForwardX11Trusted yes

of course, replacing public_dns_name with your actual AWS DNS name, then you'll be able to access your Shiny server by typing ssh aws-shiny -- this works from Linux, from Windows if you are using CygWin, from Mac. You don't need the alias with this way of setting things up. I find this easier to manage and configure.

Hey thanks for your feedback. I actually recently started using ~/.ssh/config as well for other work, so I'll add this to the guide and make mention to you in the contributions at the end of the guide.

Thanks!

Added these changes, thanks for the suggestions!