Launch and SSH (from Windows) to AWS EC2 Instance

An instance is a virtual environment in the AWS cloud to run applications on the Amazon Web Services (AWS) infrastructure. Users can use Amazon Machine Image (AMI) to launch an instance. AMI provides an operating system, application server, and necessary applications to run the server.

AWS provides free tier EC2 instances for the first year, where the user can use the t2.micro instance for free. For usage after the first year of signing up or using non-free tier instances, the user has to pay a fee. If you are concerned with if the cost is worth hosting your application, there might be various things to consider (Is AWS Web Hosting Worth It? – EnableGeek).

To log in to an instance, SSH protocol can be used. SSH or Secure Shell protocol is a cryptographic protocol that securely connects two computers over an unsecured network. By using SSH we can log in to a remote computer, and execute shell commands with a high level of security. Generally, for a better user experience you need to have a certain level of adequacy with command shells to execute commands. But there are graphical interfaces such as WinSCP for Windows and Cyberduck for Mac OS X to help you use SSH.

In this article, we will launch an EC2 instance with step-by-step guidance for beginners. We will also use SSH to log in to our EC2 instance to run our web applications.

Launching EC2 Instance in AWS

In this section, we will launch an EC2 instance from the AWS console. The AWS console interface is very user-friendly. It will take minimum effort for you to launch an EC2 instance.

ov44dNUiQtf3T79814OAXXAZWY9oHMG1M22NOaauh7y1mInP4p5Vv ZpJW SOHPmCJkjnJxJql49jFgPtyAXWuZcMS9a73EDd9522n V 5UvzltDOsJrUSg MGT O wD3eavToAbcvLucbeCa0kZHEc - Launch and SSH (from Windows) to AWS EC2 Instance

Prerequisites

  • An AWS account. 
  • You will need to add credit information. For the first year, you can use free tier resources. So if you are careful about not using priced resources, don’t worry about the cost.

Simply Launching EC2 Instance for Beginners

  • From ‘All services’ under the ‘Compute’ section select EC2.
13slAobviHxWx9e9Gkx8nzcMTixueIMag2sOKDD4RXutzybamIyhrDJgKTmuNUW2 w1N krpIQyj1EIGG4RLvJM246uCBrpYFwhFYr BBXiK0NBNQ0mVhAaw4 nFkOkcav4tlZAS5TXBwsvKk3U4wkw - Launch and SSH (from Windows) to AWS EC2 Instance
  • First, you must select an availability zone that is closer to your desired area. The availability zone assigns the physical zone of the server in which the application will be deployed. Choosee this near your current location for now.
CczPPLiCBO z iF3u0guohTWquSWxu69k UB S wxv1ZW Gs7gZBlHd9j1hCaqGSaTfqk8MQ7cff8fXLctmC4X 3lZtrnhwQMoliL4R6WVnWcnb3LEpq6O8Ffv5o4B8jcCLu2dj0YyMfY 0E7sElDWE - Launch and SSH (from Windows) to AWS EC2 Instance
  • In the EC2 panel, go to instances, then click ‘Launch instances’.
UyMHlrnUU5Pu6Z3KTK4peeGoBble6bCr0m7jlyZc3wbGesue36xi2o RIqevXoWQDU14pw5salvPl7vLZ5e1v1uKj RcsJ sZ5SAChe0qgbQQPGFVSOBJJTWtfXmZIOlaOkv3C99D2l5jsJrc4NWNUU - Launch and SSH (from Windows) to AWS EC2 Instance
  • Under ‘Name and tags’ use a preferred tag to search instances later for ease of use. This is used to group and filter instances.
EZ03Hn5Kw2XMjvqMzkMFhvTjCL71cZweDS9xH U45vLvtk DlgWPPhsRVWMZHT2x1B mbcZazODBYigBwMCoYmrHyZe8KTtxlOdrS7Quh2dCb Lp R6JypIC83B53Aebf95pA M285oXrCHiokzd1KQ - Launch and SSH (from Windows) to AWS EC2 Instance

Select the ‘Amazon Linux 2 AMI’ with free tier eligibility. There are other free AMIs. You can test out those if you like.

lw8QjWUw6jpM7Ie0sS0FFueLfzIvBfziFNk - Launch and SSH (from Windows) to AWS EC2 Instance

For ‘Instance type’ select t2.micro with free tier eligibility. It will not cost you for the first year of usage.

- Launch and SSH (from Windows) to AWS EC2 Instance

In Key pair login, click on create new key pair.

rAHdFr i7oXlrWv3TMKoNi02jx65W4D2Tuqikh7VkTmIP6b21svdOvIu LoqnLyIympPBBPaGGJPMAIYiOed9YpcatF7YoQVFTfxGfCFuKuRyvX0kiUnU7BU3JWMVtN5ZWFG4HJ0dM kj1u0T4oZV4U - Launch and SSH (from Windows) to AWS EC2 Instance

It will open up a modal. Use a key pair name. Select the private key file format as .ppk if yuseing putty in windows. If you are using OpenSSH in Linux, select .pem. Then click on ‘Create key pair’. You can use this key to log in to your EC2 instance using SSH.

i9pKZ1fsMTOmfTwo53vKjHargtWHHb sDotzY1ZeMSP4wzWcHmxkCx J2u87eCmT 6zujDErbBvEQ96wB16RAESipX3aOD R2r4iLWOIn7DOwVqjfk DDnE2uDf20j FzV2AZP9FugmBQTlRdnO7k - Launch and SSH (from Windows) to AWS EC2 Instance

A .ppk file will be downloaded to your computer. Save it for login with SSH.

  • Keep the network settings and configure storage as it is. The default settings will work for now.
xbcVQbSTEMjp 14hi7l3OovGSpZ76prNpQB4dRxboQZKrLaP - Launch and SSH (from Windows) to AWS EC2 Instance
Sra chx6INX9k VhEiM3DZSyVKBJSc0 Appx9XA tZuk5eHRJVB2yMDmwR JCdGwBtGKIioq4ijMvlQdabgsZ7KZYVSnBiJnsYZTQA9lrhC6H36G ZwlRfpCIrG1y55d9j9PGNlMqETndOV7a5jne7A - Launch and SSH (from Windows) to AWS EC2 Instance
  •  Then click Launch instance.
SdclYbqKtjiySH8NTt ttOHIhu9zBETV2qK7FKTk3uQKv2oHBnBejOWE QPGwf3gzswUf3SGgxGGANMGGM2n9UCEV3goe kKEWsI05P2EBEMN9Ozaodb6CvBmrpF137AiA1 AaKZu1EE1XIw GAuzQ - Launch and SSH (from Windows) to AWS EC2 Instance
  • If everything goes well, you should see a success screen.
TRTCGcEwSb75HexunTg9ob072V1Ih7aNdXNB - Launch and SSH (from Windows) to AWS EC2 Instance

In the instances pane, the instance should be running.

- Launch and SSH (from Windows) to AWS EC2 Instance

Congratulations on successfully launching an instance! So what next? In the network settings, we had allowed access through SSH. So in the next section, we will discuss how to log in with SSH.

SSH to AWS EC2 from Windows

BZwOnyGXcEpbp66AYN9LxZHRttaU4h TbCgU12WTcw9cAhO0Zs7xoKGjoiJy2FfFaCHcVk8uzOhKv8eBEa219DAWLCkQDgjVHH8fxmPT3180yquSU4d9nN8vF89dT Iqyc 1euuFAF6Kzx8hoypgV Q - Launch and SSH (from Windows) to AWS EC2 Instance

In this section, we are going to log in to an AWS EC2 instance with SSH from Windows OS. But most of the steps apply to other OSs also.

Prerequisites 

Step By Step Guide

  • Download and install the PuTTY. PuTTy is a popular software for SSH for Windows users.
  • Copy the public IP from the launched instance’s details.
emDj85MoDu qUlaZWtMWMKC7UmTOafWVzTCH mitj4w8LNyD4eRVoYf4hsWZhZgm7N4wkNG0MpVgFvGGYTk G2lZGJwkS2b2HmmnoZ5p4kceG7B - Launch and SSH (from Windows) to AWS EC2 Instance
  • Open up PuTTY and in the ‘Host Name (or IP address)’ input box, paste the IP. Select the connection type as SSH and port as 22.
gcubV nXFp9lIa69mjS5dxOvMdNf3KmzR5htoxL2tfI p - Launch and SSH (from Windows) to AWS EC2 Instance
  • Then in the Connection> SSH> Auth page in the private key for authentication field select your private key that was downloaded when launching the instance. The private key makes communication sec so that so no one can log in to your instances without the private key.
- Launch and SSH (from Windows) to AWS EC2 Instance
  • Then click open.

A login page will open. Enter ec2-user (it’s the default user created by EC2 while launching)

BvP - Launch and SSH (from Windows) to AWS EC2 Instance

If you are logging in for the first time, to save the key click accept.

dQcPl2o2VUS4B2r8sXnoYKb hpknvyEzqtmI1Wa pbEJVUyWBri8ul9PFQRvbX86tCNLOv4neXsUYIRz849TmHKfXygTYJH6jsviEeZ998yrB69Dt02SNK9lFGdb fzMx6F1e P2vWDv6MaiWb gX8c - Launch and SSH (from Windows) to AWS EC2 Instance

If everything goes well you should see a Linux prompt where you can run server commands.

- Launch and SSH (from Windows) to AWS EC2 Instance
  • Test with by updating.
sudo yum update

The terminal will now work as a normal Linux terminal where you can install packages, run applications, and so on.

Congratulations on your first login with SSH to your EC2 instance! We hope you enjoyed getting started on the AWS cloud platform!

Share The Tutorial With Your Friends
Twiter
Facebook
LinkedIn
Email
WhatsApp
Skype
Reddit

Check Our Ebook for This Online Course

Advanced topics are covered in this ebook with many practical examples.