- Newest
- Most votes
- Most comments
Hello.
There may be some problem with the ssh process or ssh key, so it may be a good idea to connect to the OS using Systems Manager Session Manager and troubleshoot it.
I think you can use it if you meet the prerequisites listed in the document below.
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-prerequisites.html
Also, you need to attach the IAM policy "AmazonSSMManagedInstanceCore" to the EC2 IAM role.
https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-add-permissions-to-existing-profile.html
I think there are some troubleshooting things you can do on the SSH client side:
Try reducing the privileges of the client-side key pair as follows:
sudo chmod 400 ~/.ssh/key.pem
Also, try deleting the "known_hosts" file in the .ssh directory.
cd ~/.ssh && rm -Rf known_hosts
If you are using Windows as the client OS, the answers listed on stackoverflow below may be helpful.
https://stackoverflow.com/questions/64687271/how-to-avoid-permission-denied-publickey-ssh-key-windows
Relevant content
- asked 2 months ago
- asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago