Rescuing an [[EC2]] instance in [[AWS]]
Generally, rescuing an EC2 instance would involve creating another EC2 instance, attaching the [[EBS]] storage of the other EC2 instance to that, and modifying the files from there. You then re-attach the hard drive to the first instance, and it should work after your changes.
Look at logs to figure out the error, then go from there.
# References
* https://repost.aws/knowledge-center/ec2-troubleshoot-sshd-config-edits