Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)
edited by
I need SSH access to an Amazon EC2 instance running Ubuntu. All I have is the Amazon username and password. Any ideas?

1 Answer

0 votes
by (44.4k points)
edited by

To normally access any EC2 instance using SSH, you would require a private-key file. Follow the steps below to create a private-key:

  • First, log on to your existing AWS account and open your EC2 dashboard

  • Click on "Key Pairs" on the left-hand side or go to this link https://console.aws.amazon.com/ec2/home?region=us-east-1#s=KeyPairs.

    • You would see a number of key pairs created for your EC2 instances

    • Create a new key if your private key is lost or if you don’t have any

    • Enter a unique name and hit enter.

    • Now you would see a download panel for the private key, now download and save it

    • Keep it somewhere with the file permission "0600"

  • After that, Click on "Instances" on the left-hand side or https://console.aws.amazon.com/ec2/home?region=us-east-1#s=Instances

    • You will be seeing already created instances or create one

    • Choose an EC2 machine, copy the public DNS address

    • Open your Terminal (in Linux) and type the following command

    • ssh -i /path/to/private-key root@<ec2-public-dns-address> - Choose the user or just provide “ubuntu” which is the common password for Ubuntu machines to begin with

  • hit Enter

And now it is done.

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories

...