Connecting to our EC2 instance

Saving Progress...

In this lesson, we will SSH into our newly created EC2 Instance. I will explain how you can connect from both Windows and Linux by either using the SSH command-line tool (included with Linux and also newer versions of Windows) or using PuTTY if your Windows computer does not have SSH installed by default.

Do I have SSH?

If you will be connecting from a Linux based operating system, it's very likely that you already have SSH installed. If you're on an old outdated version of Windows, however, you might now have SSH enabled. To double check, launch Command Prompt and type the command SSH. If you see output like that below, you have SSH and connecting will be very easy!

image 34
Windows SSH Client

If you're on Windows and this command returns an error, see this article for enabling SSH on your Windows computer before continuing.

Grab the EC2 instance connection Details

In the AWS Console, right-click your instance's Public IPv4 Address and select Copy:

image 36
AWS EC2 Public IPv4 Address

Connect with SSH

Now go to your terminal or Command Prompt and enter the following command to connect with the ec2-user account which is the default account for the Amazon Linux OS:

ssh -i /path/to/firstkeypair.pem ec2-user@1.2.3.4

Be sure to update the IP address to your servers IP address so it's your EC2 instances IPv4 address and not "1.2.3.4" which we used in the example above

NOTE

You will be prompted to verify the ECDSA key fingerprint, type yes and press enter:

image 41
Logging in to AWS EC2 Instances

Here is a little more information on what ECDSA is and why you see it every time you connect to a new host:

The ECDSA (Elliptic Curve Digital Signature Algorithm) key fingerprint is a unique identifier that represents an ECDSA public key. It is used to verify the authenticity of the key when connecting to a server using SSH.

If the key's fingerprint matches the fingerprint stored in the known hosts file, it means that the key is authentic and a trusted connection can be established. If it is the first time connecting to the host, the computer may not recognize the ECDSA key and the user will need to confirm that it is okay to connect.

What is ECDSA?

Now we are connected to our Linux terminal! Get job and I will see you in the next lesson!

Sign up to access the rest of this lesson

You must either log in or sign up to access this lesson.

0 0 votes
Lesson Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments