Ssh – connection closed by server in AWS

amazon-web-servicescommand-line-interfacessh

Yesterday connection to AWS server was working fine but today I'm trying to connect using the command prompt with the following:

ssh -i <mypemfile.pem> ubuntu@<my-ip-address>

I've got the error:

connection closed by IP address

I also changed the inbound rule in my security group.

I've tried to connect with filezilla, putty, winscp with no success. please help me find out the issue.

I am do from google like

ssh -v -i <mypemfile.pem> ubuntu@<my-ip-address>

it will display the following

OpenSSH_6.6.1, OpenSSL 1.0.1m 19 Mar 2015
debug1: Connecting to 52.88.36.194 [52.88.36.194] port 22.
debug1: Connection established.
debug1: identity file instacare.pem type -1
debug1: identity file instacare.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubu
ntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000
000
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 52.88.36.194

I am also checking with
telnet 22
it will display the following line and get stuck

SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2

Please help me to find out what is I am doing wrong.

Best Answer

This often happens because of lack of either memory RAM or Disk Space, which are used to allocate your new session. You can fix this by restarting your instance or wait for it to free some resources (which is unlikely)