Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.9k points)

I was given some login information for an EC2 machine, basically an ec2-X-X-X.compute-X.amazonaws.com plus a username and password.

How do I access the machine? I tried sshing:

ssh [email protected]

but I get a Permission denied, please try again. when I enter the password. Is sshing the right way to access the EC2 machine? (Google hits I found suggested that you could ssh into the machine, but they also used keypairs.) Or is it more likely that the problem is that I was given invalid login credentials?

1 Answer

0 votes
by (18.2k points)

The access to the instance is managed by the default security group, given that the instance was created with all the default wizard suggestions. The default security group will prohibit all the inbound traffic. In order to make your instance accessible, you will have to create a new rule in the security group.

Following is how you do that:

1. Go to your AWS Console

2. Go to the security Groups on the menu on the left.

3. Select the default security group

4. In the bottom pane, select inbound and then create a new rule: SSH. Click on ADD rule.

Assuming that you have the keypair of the instance, perform the following:

$ chmod 600 path/to/keypair_name.pem

$ ssh -i path/to/keypair_name.pem [email protected]

if you are working on Ubuntu instance, replace  "root" with "ubuntu" so the above command looks like:

$ ssh -i path/to/keypair_name.pem [email protected]

Related questions

0 votes
1 answer
asked Jul 10, 2019 in AWS by Amyra (12.9k points)

Want to get 50% Hike on your Salary?

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

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...