Amazon AWS EC2 Instance - Unable to Connect to SSH

It shouldn't be that hard. I cannot connect to a new instance of AWS EC2 through SSH clients. I am connecting from a Win 7 box.

OS Instance: Debian 6

AMI: debian-squeeze-i386-20121119-e4554303-3a9d-412e-9604-eae67dde7b76-ami-1977f070.1(ami-a121a6c8)

User: tried root as well as ec2-user

Using the .pem key pair generated by AWS and downloaded by me

Confirmed security group and key pair name in instance

SSH port 22 is OPEN: Nmap talks about this and Telnet receives a welcome reply

Using 3 different clients: all clients connect normally

PuTTY replies: Server refused our key

MindTerm Java browser add-on answers: Authentication failed, permission denied passed Authentication failed, permission denied

Bitvise SSH replies: Attempting 'publickey' auth; auth failed; Attempting 'publickey' auth; auth failed; Attempting 'publickey' auth; auth failed;

Reboot instance, wash, rinse, repeat ...

REBUILT new instance and a new pair of keys, wash, rinse, repeat ...

Connection is not a problem. Why does the instance not accept the .pem file as a password? Is there an extra step that I skip? I followed EVERY damn guide Google could. AWS support is a joke. stackoverflow for salvation ...

TIA.

+8
source share
7 answers

According to the debian wiki , which contains the AMI documentation that you use, the username you must use to log in is β€œadmin”.

+13
source

I had a lot of problems connecting to EC2 via ssh.

 ssh -i the-keypair-filename root@yourdomain.com 

- The Keypair file must be in the same directory. - I just used the terminal to connect.

Make sure you create or assign a key pair when starting the instance.

You can also check the key pair installed in the AWS management console, this is done by selecting the executable instance and searching for "Key Pair Name:".

I hope this will be helpful.

+1
source

My problem was that I did not add the volume that was expected in the fstab file so that the server would not start completely and the sshd daemon would not start.

Note:

  telnet HOST 22 

Check the server logs to make sure that it starts correctly before spending a lot of time like me.

+1
source

Amazon Linux AMIs that use the ec2 user password are listed at the bottom of this page.

http://aws.amazon.com/amazon-linux-ami/

Make sure you use one of these when trying to use the ec2 user or check the documentation for the AMI that you are using.

Teri

0
source

Try using the username "admin" and ignore the username suggested by Amazon.

0
source

I had a similar problem and solved the problem using the following approach.

1) Edited the knife.rb file in my chef folder, i.e.: \ Users \ Administrator \ chef-starter \ chef-repo.chef \ knife.rb, as shown below:

 knife[:aws_access_key_id] = "xxxxxxxxxxxxxxxxxxxx" knife[:aws_secret_access_key] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" knife[:region] = 'ap-southeast-1' knife[:aws_ssh_key_id] = "ChefUser" knife[:ssh_user]="ec2-user" 

At the command prompt, a command is issued to create an ec2 server:

 knife ec2 server create -r "role[webserver]" --image ami-abcd1234 --flavor t1.micro -G ChefClient -x root -N server01 -i H:\Chef-files\ChefUser.pem 

Please note that although I gave all the details in the knife.rb file, I had to specify the path of the .pem file in the coomand line via the -i option. This solved my problem.

Check if my solution will help.

Greetings

Chandan

0
source

Logging in as "ubuntu" worked for me:

ssh -i private_key.pem ubuntu @myubuntuserver

Hope this helps

- Erin

-2
source

All Articles