I could connect to ec2 instance with the following command, but today I couldn't connect using it.
ssh -i abcKey.pem [email protected] -v
Following is the verbose. I have opened SSH port in EC2 ( I could connect to this till yesterday)
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-x-x-x-x.ap-southeast-1.compute.amazonaws.com [x-x-x-x] port 22.
debug1: Connection established.
debug1: identity file abcKey.pem type -1
debug1: identity file abcKey.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
This error occurs if you created a password for your key file, but haven't manually entered the password. To resolve this error, enter the password or use ssh-agent to load the key automatically. There are a number of reasons why you might get an SSH error, like Resource temporarily unavailable.
Error message: "ssh: connect to host ec2-X-X-X-X.compute-1.amazonaws.com port 22: Connection refused". This message comes from a host remotely. The following are common causes for this error: The host reached the instance but there was no service listening on the SSH port.
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.
One possible problem is that the Security Group restrictions are too strict for you to be able to connect. To fix this:
I was having the same issue. I followed what Amazon suggested in a video for handling a hanging SSH connection attempt. No dice. What worked in my case was using the following command:
ssh -i yourKeyHere.pem ec2-user@yourPublicIPHere -v
The publicIP is listed under publicIp in the EC2 management console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With