Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

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

Closed
ekuns opened this issue May 12, 2015 · 2 comments

Comments

@ekuns
Copy link

ekuns commented May 12, 2015

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.

@chrisrzhou
Copy link
Owner

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!

@chrisrzhou
Copy link
Owner

Added these changes, thanks for the suggestions!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants