0 votes
1 view
in AWS by (19.2k points)

Recently I set up a new EC2 instance. The next day I was not able to connect to my instance via ssh. I could connect and disconnect the day before, I swear I did nothing. here is ssh debug info:

ssh -i webserver.pem -v [email protected]

OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011

debug1: Reading configuration data /etc/ssh_config

debug1: /etc/ssh_config line 20: Applying options for *

debug1: Connecting to my.elastic.ip [my.elastic.ip] port 22.

debug1: Connection established.

debug1: identity file webserver.pem type -1

debug1: identity file webserver.pem-cert type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1

debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.9

debug1: SSH2_MSG_KEXINIT sent

Connection closed by my.elastic.ip

Is there a way to resolve this issue? Or shall I reinstall my instance again? Please, help as I need to resolve this asap. Your help is highly appreciated!

PS rights to my .pem are set to 600.

1 Answer

0 votes
by (44.6k points)

In your security group, keep these setting to outbound rule to allow all traffic

type: All traffic, Protocol: All, Ports: All, Destination: 0.0.0.0/0

Also, if you still have a problem, then check whether you are using the correct username or not. For Ubuntu instance, it is ‘ubuntu’ and for Amazon Linux instances, it is ec2-user.|

For more valuable information on Elastic Cloud Compute, you can visit AWS EC2.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...