Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH EC2 asking for password

I've just setup my EC2 server following this video here exactly - http://www.youtube.com/watch?v=bBajLxeKqoY

I even chose the same server type, everything went well until it asked for the root password to my EC2 server...

Any suggestions?

like image 298
Matt Avatar asked Mar 17 '12 06:03

Matt


People also ask

How do I find my EC2 instance password?

Open the Amazon EC2 console, and then choose Instances. Select the check box for the instance, and then expand the Actions dropdown list. If you're using the old console, then choose Get Windows Password. If you're using the new console, choose Security, and then choose Get Windows Password.

How do I access EC2 through SSH?

To connect from the Amazon EC2 consoleOpen the Amazon EC2 console. In the left navigation pane, choose Instances and select the instance to which to connect. Choose Connect. On the Connect To Your Instance page, choose EC2 Instance Connect (browser-based SSH connection), Connect.

What is the password for EC2-user?

It enables a user to log in to an Amazon EC2 Linux host with an SSH client, without having to enter a password. For Amazon EC2 Linux instances, the default user name is ec2-user.


2 Answers

Update

Updating this answer because of the activity:

Depending on if the system is ubuntu or Rhel the user varies.

For ubuntu it is

ssh -i my-pem-file.pem ubuntu@my-ec2-instance-address 

For RHEL it is

ssh -i my-pem-file.pem root@my-ec2-instance-address 

Connecting to an ec2 instance does not require a password, it would require only a pem file and this is how you connect to it

ssh -i my-pem-file.pem ec2-user@my-instance-address 

and remember to chmod 400 your pem file before ssh'ing

like image 192
Dhiraj Avatar answered Sep 29 '22 17:09

Dhiraj


If you need to do things as root once you are in as ec2-user, use sudo su - that gets you to root and doesn't need a password. Somethings you do need that for, like looking at the tomcat log files

like image 30
Peter Avatar answered Sep 29 '22 17:09

Peter