0% found this document useful (0 votes)
7 views

cloud computing file

This document provides a comprehensive guide on creating an EC2 instance on AWS and connecting to it using PuTTY with a key pair. It includes detailed steps for launching an instance, configuring settings, generating a PuTTY private key, and connecting via SSH. Additionally, it covers alternatives for connecting without a key pair and various use cases such as hosting websites and running commands remotely.

Uploaded by

triptiofficial29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

cloud computing file

This document provides a comprehensive guide on creating an EC2 instance on AWS and connecting to it using PuTTY with a key pair. It includes detailed steps for launching an instance, configuring settings, generating a PuTTY private key, and connecting via SSH. Additionally, it covers alternatives for connecting without a key pair and various use cases such as hosting websites and running commands remotely.

Uploaded by

triptiofficial29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Create EC2 instance and connect with PuTTY (With key pair)

1. Open your web browser and go to the AWS Management Console: AWS Console.

2. Log in using your AWS account credentials.

2: Navigate to the EC2 Dashboard

1. Once logged in, click on “Services” in the top menu bar.

2. Under “Compute,” select “EC2” to access the EC2 Dashboard.

3: Launch Instance

1. In the EC2 Dashboard, click on the “Instances” link in the left-hand navigation pane.

2. Click the “Launch Instance” button to begin the instance creation process.

4: Choose an Amazon Machine Image (AMI)

1. In the “Choose an Amazon Machine Image (AMI)” step:

 Select an AMI based on your requirements (e.g., Amazon Linux 2, Ubuntu Server,
Windows Server).

 Click “Select” to proceed.

5: Choose an Instance Type


1. In the “Choose an Instance Type” step:

 Select the instance type based on your workload and performance needs.

 Click “Next: Configure Instance Details” to continue.

6: Configure Instance Details

1. In the “Configure Instance Details” step:

 Configure settings such as the number of instances, VPC, subnet, IAM role (if
applicable), etc.

 Customize other options as needed.

 Click “Next: Add Storage” to proceed.

7: Select Key Pair

1. In the “Select an existing key pair or create a new key pair” pop-up window:

 Choose an existing key pair or create a new one.

 Download the private key (.pem file) if you are creating a new key pair.

 Click “Launch Instances” to finalize and launch your EC2 instance.


8: Add Storage

1. In the “Add Storage” step:

 Specify the size and type of the root volume (EBS) for your instance.

 Add additional volumes if required.

 Click “Next: Add Tags” to continue.

9: Add Tags (Optional)

1. In the “Add Tags” step:

 Optionally, add tags to your instance for better organization and management.

 Tags are key-value pairs (e.g., Name: MyEC2Instance).

 Click “Next: Configure Security Group” to proceed.

10: Configure Security Group

1. In the “Configure Security Group” step:

 Create a new security group or select an existing one.

 Configure inbound and outbound rules to control tra ic to and from your instance (e.g.,
SSH, HTTP, HTTPS).
11: Review Instance Launch

1. In the “Review Instance Launch” step:

 Review all the configuration details of your instance.

 Make sure everything is set up correctly.

 Click “Launch” to start the instance creation process.

12: Access Your EC2 Instance

1. Once the instance is launched successfully, you can view its status in the EC2
Dashboard under “Instances.”

2. Use the downloaded private key (.pem file) to SSH into your instance if it’s a Linux-based
instance or use Remote Desktop Protocol (RDP) for Windows instances.
That’s it! You have successfully created an EC2 instance on AWS and can now start using it for
your applications or development purposes. Make sure to manage and monitor your instances
regularly through the AWS Management Console.

How to Generate a PuTTY Private Key (.ppk) File

1: Download PuTTY and PuTTYgen

1. If you haven’t already, download PuTTY and PuTTYgen from the o icial PuTTY
website: PuTTY Download

2. Install PuTTY on your Windows machine. During the installation process, PuTTYgen
should also be installed.

2: Convert the Private Key to PuTTY Format (.ppk)

1. Open PuTTYgen by searching for it in your Windows start menu or by


running puttygen.exe from the PuTTY installation directory.

2. In PuTTYgen, click on the “Load” button.

3. By default, PuTTYgen filters for “PuTTY Private Key Files (.ppk).” Change the file type filter to
“All Files (.*)” to see your .pem private key file.

1.

4. Navigate to the location of your .pem private key file, select it, and click “Open.”
5. PuTTYgen will prompt you to confirm the conversion of the key. Click “OK” to continue.

6. Optionally, you can set a passphrase for added security by entering it in the “Key passphrase”
and “Confirm passphrase” fields. This step is optional but recommended.

7. Click on the “Save private key” button to save the converted private key in PuTTY’s .ppk
format.

8. Choose a location to save the .ppk file and give it a descriptive name (e.g., mykey.ppk).

9. Click “Save” to complete the process.

Now you have successfully generated a PuTTY Private Key (.ppk) file from your original private
key (.pem) file. This .ppk file can be used with PuTTY to connect securely to your AWS EC2
instances or other SSH servers. Remember to keep your private key files secure and never share
them publicly or with unauthorized individuals.

How to Connect EC2

1. Open PuTTY on your Windows machine.

2. In the “Category” pane on the left, expand the “SSH” category and click on “Auth.”

3. Click on the “Browse” button next to “Private key file for authentication” and select the
.ppk file you generated in Step 2.

4. Go back to the “Session” category in the “Category” pane.

5. Enter the EC2 instance’s Public IP address into the “Host Name (or IP address)” field.
6. Optionally, enter a name for your session in the “Saved Sessions” field and click “Save” to
save these settings for future use.

7. PuTTY will open a terminal window and attempt to establish an SSH connection to your EC2
instance.

You are now connected to your EC2 instance via SSH using PuTTY. You can run commands and
manage your instance from the terminal window.
2. Remotely Run Unix Commands on an EC2 Instance

Option 1: Using PuTTY

1. After connecting to the instance using PuTTY:

o Run commands directly in the terminal.

o Example commands:

uname -a # Check system details

df -h # Check disk usage

top # Monitor system processes

Option 2: Using AWS Session Manager (IAM Role Required)

If you prefer not to use key pairs or PuTTY, you can use AWS Session Manager.

1. Create an IAM Role:

o Go to IAM Service → Roles → Create Role.

o Select AWS Service → EC2.

o Attach the AmazonSSMManagedInstanceCore policy.

o Attach the role to the EC2 instance.

2. Enable Systems Manager Agent:

o Ensure SSM Agent is installed and running:

sudo yum install amazon-ssm-agent -y

sudo systemctl start amazon-ssm-agent

3. Run Commands Using Session Manager:

o Navigate to the EC2 instance in AWS Console.

o Click Actions → Connect → Session Manager.

o Run commands directly in the AWS console.

Option 3: Using AWS CLI

1. Install and configure the AWS CLI on your local machine.

aws configure
2. Use the aws ssm send-command to execute commands:

aws ssm send-command \

--targets "Key=instanceIds,Values=<instance-id>" \

--document-name "AWS-RunShellScript" \

--comment "Run Unix commands" \

--parameters 'commands=["<your-command>"]'

Replace <instance-id> and <your-command> with appropriate values.

1. Create EC2 Instance and Connect with PuTTY (Without Key Pair)

Step 1: Launch EC2 Instance

1. Log in to the AWS Management Console.

2. Go to EC2 Service → Launch Instances.

3. Choose an AMI (e.g., Amazon Linux 2 or Ubuntu).

4. Select an Instance Type (e.g., t2.micro for free-tier eligibility).

5. For Key pair (login), select Proceed without a key pair.

6. Configure Security Group Rules:

o SSH: Port 22, Source: My IP.

o Add additional rules as required.

7. Click Launch Instance and wait for the instance to start.

Step 2: Connect Using PuTTY

1. Set up password-based SSH login (as described in the previous answer).

2. Open PuTTY, enter the public IP of the EC2 instance, and connect using your
credentials.

2. Host a Static Website on EC2

Step 1: Install a Web Server

1. Connect to the EC2 instance using PuTTY.


2. Install a web server (e.g., Apache or NGINX):

sudo yum update -y

sudo yum install httpd -y

sudo systemctl start httpd

sudo systemctl enable httpd

Step 2: Upload Website Files

1. Place your static website files in the Apache document root:

sudo mv /path/to/your/website/files/* /var/www/html/

2. Open HTTP tra ic in the Security Group (Port 80).

Step 3: Access the Website

 Open a browser and navigate to the Public IPv4 Address of the instance.

3. Host an E-Commerce Website Using AWS

To host an e-commerce website, follow these steps:

Step 1: Choose Platform

1. Use platforms like WordPress or Magento.

2. Install required software (e.g., LAMP stack).

Step 2: Set Up EC2 Instance

1. Launch an EC2 instance.

2. Install dependencies:

sudo yum install php php-mysql mysql-server -y

sudo yum install httpd -y

sudo systemctl start httpd

3. Deploy the e-commerce platform (e.g., download Magento or WordPress files).

Step 3: Configure RDS (Optional)

 Use Amazon RDS for the database backend to manage scalability and performance.
Step 4: Upload Files and Configure

1. Upload the platform files to /var/www/html/.

2. Configure database connection and other settings.

Step 5: Domain and SSL

 Point your domain to the instance's IP using Route 53 and set up SSL using AWS
Certificate Manager.

4. Remotely Run Commands on EC2 (Using IAM Role Without Key Pair)

Step 1: Create IAM Role

1. Go to IAM Service → Roles → Create Role.

2. Choose AWS Service → EC2.

3. Attach required policies (e.g., AmazonS3ReadOnlyAccess).

4. Attach the role to the EC2 instance.

Step 2: Use AWS Session Manager

1. Ensure the instance has SSM Agent installed and running.

sudo yum install amazon-ssm-agent -y

sudo systemctl start amazon-ssm-agent

2. Connect to the instance:

o Go to EC2 → Actions → Connect.

o Use the Session Manager to run commands directly in the AWS console.

5. Deploy Identical Services Using IaaS, PaaS, and SaaS

Step 1: IaaS (Infrastructure as a Service)

 Launch an EC2 instance and manually set up a web server.

 Store assets in an S3 bucket.

Step 2: PaaS (Platform as a Service)


 Use AWS Elastic Beanstalk to deploy a web application.

1. Upload application code.

2. Elastic Beanstalk handles scaling, provisioning, and deployment.

Step 3: SaaS (Software as a Service)

 Use a SaaS platform like Shopify or Salesforce for hosting a fully-managed service.

6. Deploy an IaaS Solution Using EC2 and S3

Step 1: Launch EC2 Instance

 Launch an EC2 instance with necessary configurations (key pair optional).

Step 2: Set Up Web Server

 Install a web server (Apache/NGINX).

 Configure the server to host a website or application.

Step 3: Use S3 for Static Files

1. Create an S3 bucket.

2. Upload static files (e.g., images, videos).

3. Enable bucket permissions for public access (optional) or use pre-signed URLs.

Step 4: Integrate EC2 with S3

 Use the AWS CLI or SDK to fetch files from S3:

aws s3 cp s3://bucket-name/path-to-file /path-on-ec2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy