I've changed following line in the ssh_config file to enable password logging:
After that I've reboot the ec2 instance. Now trying to ssh but it saying refused connection.
ssh -vvv -i _key_.pem ubuntu@instance_ip
OpenSSH_7.4p1, LibreSSL 2.5.0` debug1: Reading configuration data /etc/ssh/ssh_config` debug2: resolving 'instance_ip' port 22` debug2: ssh_connect_direct: needpriv 0` debug1: Connecting to 'instance_ip' ['instance_ip'] port 22.` debug1: connect to address 'instance_ip' port 22: Connection refused` ssh: connect to host 'instance_ip' port 22: Connection refused
I've checked the port 22 which is allowed in the security group.
Now I'm unable to login to the server. Is there any way to ssh to the instance or recover data and config files in it?