- Now let's talk about key pairs within Amazon EC2.
Key pairs, or public private keys
are the way in which we can authenticate
into the operating system of our EC2 instances.
You remember when we talked earlier
about authenticating against the AWS API,
we use a certain set of access keys for that,
using IM users and groups.
What we're talking about here
is the OS level of authentication.
Here, in order to get into the operating system,
or EC2 instance, we need a key pair.
Now, these are 2048-bit SSH-2 RSA key pairs.
We will create these within the AWS console,
and then when we go to launch an EC2 instance,
we will choose that key pair at that time.
Now, when we create the key pair,
Amazon web services will keep the public key.
They will give us the opportunity
to download the private key, and then at that point,
they will not longer keep the private key.
So you do have one short window in which to download
the private key before Amazon gets rid of it.
How this works is that when we launch a Linux EC2 instance,
Amazon web services will take that public key
that they're keeping, and they will add it to the
.ssh/authorized_keys files for your particular admin user.
Like in the case of Ubuntu,
they will add it to the Ubunto user.
In the case of Amazon Linux, they will add it to the,
what we call the EC2 user.
And we will use it, when we go to log in
our SSH into that Linux machine,
we will use our private key that we downloaded
in order to authenticate against that operating system.
In the case of Windows, the administrator password
will be encrypted using the public key,
and we will use our private key to decrypt
the Windows administrator password.
So again, key pairs are the way in which
we authenticate into the operating system
of Amazon Elastic Compute Cloud instances.