Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon AWS EC2 Instance - Can't connect with SSH

This shouldn't be this hard. I cannot connect to new AWS EC2 instance via SSH clients. I am connecting from a Win 7 box.

Instance OS: Debian 6

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

User: tried root and also ec2-user

Using .pem keypair that AWS generated and I downloaded

Confirmed security group and Key Pair Name on instance

SSH port 22 is OPEN: Nmap says so and Telnet gets a welcome reply

Using 3 different clients: all clients connect ok

PuTTY replies: Server refused our key

MindTerm Java browser add-in replies: Authentication failed, permission denied

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

Rebooted instance, wash, rinse, repeat...

REBUILT new instance and new keypair, wash, rinse, repeat...

Connecting isn't the issue. Why would the instance not accept the .pem file as the password? Is there an additional step I am missing? I followed EVERY frigging guide I could Google. AWS support is a joke. stackoverflow to the rescue...

TIA.

like image 908
Geek Stocks Avatar asked Jan 22 '13 19:01

Geek Stocks


2 Answers

According to the debian wiki which has documentation on the AMI you are using, the username you need to use to login is 'admin'.

like image 117
datasage Avatar answered Sep 22 '22 13:09

datasage


I have had many issues with connecting to EC2 via ssh.

ssh -i the-keypair-filename [email protected]

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

Make sure you generate or assign the keypair when launching the instance.

Also you can verify the keypair you have set in the AWS Management Console, this is done by selecting the running instance and then looking for "Key Pair Name:".

I hope this is helpful.

like image 27
CoderDan Avatar answered Sep 20 '22 13:09

CoderDan