In this video we're going to add a SSH key pair to AWS the reason we do this is
so that when we create our server we can connect to it using ssh authentication
this is the same method of authentication that we use to connect to
github if you remember way back in the previous videos we created an SSH key
pair which we added on our local system and then put the public key pair on
github we're going to do the same thing here except we're going to be creating or
adding the public key pair to AWS instead of github so let's get started
we're going to start by outputting the content of our SSH key pair public file
so open up the git bash or the terminal window and we want to get a terminal
window on our local machine not on the vagrant server it's very important that
it's running on our local machine otherwise you won't be able to access
the SSH key we need to set up the authorization
okay so we're going to output
it by typing cat then tilde forward slash dot SSH forward slash ID underscore RSA dot pub
it's very important
that you add the pub for public because we want to output the public file for
our key so hit enter there and then we can copy the contents right from the
beginning ssh RSA all the way to the end where the comment ends let's right-click
that and copy and then open up the Google Chrome browser and we want to
make sure that we are logged in to our AWS console now AWS modify their
products all the time so your console may not look exactly like mine but
fundamentally you should have the AWS and the services option here so we're
going to click on services we're going to head over to EC2
EC2 is where the
key pairs can be added for use on our server instances so on the left-hand
side here let's scroll down and find the bit that says key pairs here underneath
network and security click on key pairs to open up the key pair page what we're
going to do is we're going to import a key pair because we already have a key pair
created that is our private key and our public key and we're just going to click
import here and we'll give it the name I'm going to call it mark - desktop I recommend
you give it a name that matches the laptop or computer that you are
authenticating then under the public key contents box we're going to paste the
contents of our public key let's just make sure that the contents are fully
pasted here ssh RSA and it should end in the comment
ok then all we need to do is
hit import and this will import our public key into AWS