- Newest
- Most votes
- Most comments
First off, it's actually pretty common for EC2 instances running Red Hat to have root SSH access disabled by default. It's a security thing. Instead, you're supposed to use a default user account - for RHEL, that's usually 'ec2-user'.
Have you tried logging in with 'ec2-user'? Once you're in, you should be able to switch to root with a simple "sudo su -".
If sudo isn't working, things get a bit trickier. You might need to use EC2 Instance Connect or Systems Manager Session Manager. These are lifesavers when you're locked out. That error you're seeing - "no supported authentication methods available" - usually means there's something going on with your SSH setup. Double-check your PPK file permissions and make sure the public key is in the right spot on your instance.
If you're still stuck, EC2 Instance Connect is your next best bet. It's super easy to use right from the EC2 console. Just select your instance, hit 'Connect', and choose 'EC2 Instance Connect'. You can connect as root from there.
As a last resort, you can always detach the root volume, attach it to another instance, and fix things manually. It's a bit of a process, but it works!
For future reference, try to avoid using the root user for everyday stuff. It's safer to set up an IAM user with the permissions you need.
Here are some docs that might help: EC2 Instance Connect: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html systems Manager Session Manager: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html Connecting to Your Linux Instance: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html
Relevant content
- asked 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago