DEV Community

Shubham Srivastava
Shubham Srivastava

Posted on

Devops learning complete guide(5)

Creating an id in aws and configuring with cli

Create an aws account->

Connecting to AWS (Amazon Web Services) from a Linux terminal typically involves using the SSH (Secure Shell) protocol. Here are the general steps to connect to an AWS instance from your Linux terminal:

Prerequisites:
AWS Account:

Make sure you have an AWS account and the necessary permissions to access EC2 instances.
Key Pair:

When you launch an EC2 instance, you will need to specify a key pair. Download and save the private key file (.pem) securely on your local machine.

Steps:
Open Terminal:

Open your Linux terminal on your local machine.
Navigate to the Directory:

Move to the directory where you saved your private key file using the cd command.

cd /path/to/your/keypair/

Change Key File Permissions:
Set the correct permissions for your private key file.

chmod 400 your-key-pair.pem

Connect using SSH:

Use the ssh command to connect to your AWS instance. Replace your-instance-ip with the actual public IP address or DNS name of your AWS instance and your-key-pair.pem with the name of your private key file.

ssh -i your-key-pair.pem ec2-user@your-instance-ip

If your instance uses a different username (e.g., ubuntu for Ubuntu instances), replace ec2-user with the appropriate username.

Confirm Connection:
If prompted to confirm the connection, type "yes" and press Enter.
Connected to AWS Instance:

You should now be connected to your AWS instance via the Linux terminal.

Successfully changed
[ec2-user@ip-xxx-xx-xx-xxx ~]$

AWS Ec2

Top comments (0)