I had successfully connected in windows CMD to AWS EC2 Kali Linux instance which was working fine all morning. later in the afternoon using the same syntax: ssh -i newkey.pem [email protected]
I now get the error:
The authenticity of host '34.240.206.45 (34.240.206.45)' can't be established. ECDSA key fingerprint is SHA256:S5ZcR47VrH/jzq5vbv4eB/rVjjrx1fm5HmNjzYe//ek. Are you sure you want to continue connecting (yes/no/[fingerprint])? Host key verification failed.
-Security group is configured to allow all access via port 22.
-I have tried creating new instances with new key pairs and encounter the same issue.
-I have also tried clearing offending ssh keys from known_hosts and still have the same issue.
CodePudding user response:
If you really need a quick fix, you can remove the hostname file :D
sudo rm ~/.ssh/known_hosts
If you are patient and you'd like to keep other values in the known_hosts file, then edit it and remove the line associated with your previous EC2:
sudo nano ~/.ssh/known_hosts
CodePudding user response:
Deleting known_hosts is the best solution, but you can also try to run SSH commands remotely using "ssh -o StrictHostKeyChecking=no user@IP command". Not the ideal solution in your case, but it may help to some extent.
