How To Transfer Files To Amazon EC2 Instance From Local System

There might be some scenarios, where you may want to transfer files from an Amazon EC2 instance to your local system or from local system to Amazon EC2 instance. There are various tools such as FileZilla, FTP etc. that can be used to transfer files to Amazon EC2 instance from local Windows or Linux system. Here, we would explain a very useful tiny tool “WinSCP” to transfer files to Amazon EC2 Linux instance from local system and vice-versa.

We assume that you have already converted keypair.pem file into keypair.ppk file using the PuTTYgen tool. If not, click here to know how to do it.

First of all, visit the official website of WinSCP and download this tool for Windows platform.

Steps To Transfer Files To Amazon EC2 Linux Instance From Local System

To transfer files to Amazon EC2 Linux instance from your local system, you need to perform the following steps:

  1. Just double-click the setup file and complete the installation of WinSCP tool using the default selections.Installing WinSCP on Windows
  2. Open the WinSCP console and fill the information such as Host name: Public IP or DNS domain name. User Name: User name of EC2 instance. Port: Default 22.Transfer Files to Amazon EC2 Linux Instance from local windows system
  3. Click the Advanced button. The new window will be displayed. Select the SSH in the left pane and then select Authentication.
  4. Here, you need to browse and select the keypair key (extension .ppk) that you have converted previously.Move files from Local system to EC2 instance
  5. Click OK to proceed and then click Login. On the Warning dialog box, click Yes to proceed.
  6. On the WinSCP console, select the local files from left pane and drag the files (that you want to transfer) in the right pane. The default EC2 file location is user’s home directory.Transfer files to Amazon EC2 Linux Instance
  7. To verify, connect your EC2 instance and list the files under user’s home directory. You should be able to see the files you have transferred from the local system to EC2 Linux instance as shown in the following figure.

Verify file transfer in EC2 Ubuntu Instance

Recommended: Various ways to connect EC2 Linux instance.

That’s all you need to transfer files between local system and Amazon EC2 instances. Hope, it helped you. If you have any query, please write us in the comment box, we will try to solve those.

Posted in AWS Cloud Tagged with: , ,

Connect EC2 Linux Instance Using: Putty, GitBash, and Web Browser

In the previous post, we have explained how to create and launch an EC2 instance. Here, we assume that you have already running a EC2 instance and now want to connect EC2 instance. There are various options that you can use to connect your EC2 instance. Here, we will discuss “How to connect EC2 Linux Instance and work remotely. We will cover Windows EC2 instance connection options in a separate article.

You can connect an EC2 Linux instance using the following method:

  1. Connect EC2 Linux Instance Using Web Browser
  2. Connect EC2 Instance Using PuTTy
  3. Connect EC2 Linux Instance Using GitBash

Connecting EC2 Instance Using Web Browser

In this method, you can use your Web Browser to connect EC2 instance. However, you need to install the compatible version Java for your browser. Few of the Web Browsers such as Chrome may not work properly for the EC2 connection. We recommend to use Internet Explorer with compatible version of Java installed. To connect your EC2 instance using Web Browser, you need to perform the following steps:

  1. First, download the compatible version of Java and install it properly. The process is pretty simple and should not be a challenge for a technical guy.Connect EC2 Linux Instance using Web Browser
  2. Once the Java is installed, make sure you have also turned on the Java Adds-on in Internet Explorer as shown in the following figure.Connecting EC2 instance using browser
  3. Now, select and right-click your EC instance and then select Connect.
  4. On the Connect To Your Instance window, select A Java SSH Client Directly option.
  5. Browse and select the key pair associated with this instance, and then click Launch SSH Client as shown in the following figure.Connecting EC2 Instance using Internet Explorer
  6. A new terminal console will be displayed and you will get the EC2 terminal console, where you can perform the desired tasks for your EC2 instance as shown in the following figure.Java EC2 Instance console

Connecting EC2 Linux Instance Using PuTTY

PuTTY is the most popular tool to access SSH and other remote connections such as Telnet. Most of the AWS Administrators use PuTTY to connect EC2 Linux instances. In this method, we are going to explain how to use PuTTY to connect EC2 instances.

First you need to download and install PuTTY and PuTTYgen tools on your local system. Its pretty straight forward process and you should be able to do it very easily. You can download PuTTY and PuTTYgen tools here.

Download PuTTY tools

  1. Once you download and installed the above mentioned tools, open the PuTTYgen console.
  2. Click Load and browse the key pair, in the browse window select the File Types as All and then select .pem file.
  3. Click Load to save the key pair file from .pem to .ppk. Optionally, you may also set the passphrase for this converting key for more security.
  4. Now, open the PuTTY tool and paste the Public IP or DNS name of your EC2 instance. The format should be followed as user@ec2-public-ip-address or user@ec2-domain-name. example: ubuntu@54.55.56.57
  5. Scroll-down in the left pane, expand the SSH section and select Auth option.
  6. Browse and select converted key pair (extension .ppk) and then click Open to open the SSH console.
  7. A Security Alert will be displayed, read it and click Yes to proceed.
  8. Now, you should be able to access terminal of EC2 instance as sown in the following figure.

 

Connecting EC2 Instance Using GitBash

Apart from the above-mentioned methods to connect EC2 instances, there are few more tools such as GitBash that you can use to connect EC2 Linux instances. GitBash is my most loved tool for connecting EC2 Linux instances. You just need to download and install it, which is pretty simple.

For the Windows version of GitBash, double-click the setup file and just follow the on-screen installation instructions.
Install GitBash for Windows

Download GitBash tool for Windows

  1. Once the GitBash tool is downloaded, open it and go the directory where you have saved the key pair file.
  2. On the GitBash terminal, paste the EC2 instance’s public IP address or domain name in the following format:

$ ssh -i “ec2-key-pair-name.pem” user@ec2-public-ip-address

$ ssh -i “ec2-key-pair-name.pem” user@ec2-domain-name

Here, ssh is the command, -i means importing key, ec2-key-pair-name.pem is key pair name. Let’s have look at the following figure.

Connect EC2 Instance using GitBash for Windows

In this article, we have explained various methods that you can use to connect EC2 Linux instances. Hope, you loved this. Keep browsing our blog for more upcoming articles.

Posted in AWS Cloud

How To Create EC2 Instance – Step By Step Guide

Needless to say that AWS Amazon is real leader in Cloud platform. Many reputed companies’ infrastructure is hosted on AWS Cloud. If you have never worked with Amazon AWS platform, do not worry, we would explain all the important step by step tutorials to learn Amazon AWS easily. In this post, we will focus on “how to create EC2 instance using AWS console”.

Recommended: Amazon EC2 Getting Started Guide.

Steps to Create EC2 Instance

There are various steps that you need to perform to create an EC2 instance. Let’s o with each off them in detail.

  • Signing In to AWS Console

This is the first and most basic step that we assume should be self-explanatory. Just click the EC2 option under the Compute section as shown in the following figure.

Create EC2 Instance

Launch EC2 Instance

To launch an EC2 Instance, click the Launch Instance button as shown in the following figure. Launching EC2 Instance

Selecting EC2 AMI

What is AMI?

An AMI is a template that contains the software configuration including operating system and application server.

You can select an AMI provided by AWS or you can select one of your own AMIs. Here, for the testing purpose, select the AMI type as Ubuntu and then proceed to next.

Recommended: Learn more about EC2 Instance Type
Selecting Amazon AMI Types

Note: You can also change the instance AMI type later as per the future requirements.

Selecting EC2 Instance Type

EC2 Instance Types are actually profiles with pre-defined hardware and other resources settings such as number of vCPUs, RAM and Disk size. You can choose any of the available instance type as per your requirements. However, instance type containing more hardware resources would be more expensive than others. Luckily, there is one option called Free Tier that allowed you to create and use a T2 Micro instance free of cost with limited time of period. For the testing purpose, select the T2 Micro instance type and proceed to the next page.

Selecting AWS EC2 Instance Type

Recommended: Learn more about EC Instance Type

Configuring EC2 Instance Settings

In this page, you need to specify some basic settings for your EC2 instance. The following are the basic settings that you need to adjust:

  1. Network: Use the default VPC or create a new one.
  2. Subnet: Use the default subnet or create a new subnet as per your requirements.
  3. Auto assign IP: If enable, then a public IP would be assigned to this EC2 instance, else no public IP would be assigned to this instance.

Configure EC2 instance settings

Adding Storage with EC2 Instance

In this page, you can use the default allocated storage size (8 GB), you can increase it, or you can also add multiple volumes as per your storage requirements. For the testing purpose, just accept the default setting and proceed to the next page.Add EC2 Storage Volume

Adding Tags for EC2 Instance

In this page, you can define tags to identify and differentiate your instance. As of now, adding Name tag would be sufficient. Click Add Tag, specify instance name, and proceed to the next page.

Adding EC2 Tags

Configuring EC2 Security Group

AWS security groups are actually virtual firewall that controls the inbound and outbound network traffic. Here, at least you need to allow SSH service for remote access. For this exercise, you can allow SSH it for all IPs, but we highly recommend to select My IP Address option to limit the SSH access. In the production network, be careful and only allow the required ports in security group.

AWS SSH Firewall Rule

Launching EC2 Instance

Proceed to the Review page and click Launch to launch instance. The Key Pair window will be displayed. Here either you can use an existing Key Pair or create a new one. For the first time, select create a new key pair, specify key pair name, and then click Download Key Pair.EC2 Keypair Download

Finally, click Launch Instances to launch this instance. The instance will be ready within few minutes and you would see it in the EC Instance list in AWS console.Create EC2 Instance

That’s all you need to do to create EC2 instance using AWS Amazon console. Now, you can connect your instance and perform the management task as per your requirement. You can use Putty, GitBash, or any other tool as per your comfort to connect an EC2 instance.

We will discuss all the remote connect options for an EC2 instance in a separate article, so stay connected with us. Please like and share us.

Posted in AWS Cloud Tagged with: ,