I'm trying to connect to an AWS ec2 instance but I keep being refused. I'm using the same computer, the same wifi but suddenly when I connect to one of my ec2 instance, it fails.
when I connect, it says..
ssh -i successintoeflcom.pem [email protected]
ssh: connect to host 52.68.152.179 port 22: Connection refused
ssh -v successintoeflcom.pem [email protected]
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 26: Applying options for *
ssh: Could not resolve hostname successintoeflcom.pem: nodename nor servname provided, or not known
I looked at /etc/ssh_config line 26, and found
Host *
SendEnv LANG LC_*
something got to be wrong, but I haven't found a way to make it right.
I also tried deleting the ec2 instance and make new one with new ssh key and new EIP but it did not work. honestly, I'm new to ssh settings. Any help would be appreciated.
PS For some reason, I was able to connect to other ec2 instance that is on other aws account, which I use for work.
Check the Security groups inbound settings, make sure ssh protocol enabled with source as anywhere. Because your System IP address might change.
Check with .pem file permission. It should be set with chmod 600.