- Newest
- Most votes
- Most comments
Hello.
Please try setting up an IAM role for your EC2 instance and connecting via Systems Manager Session Manager.
If you are not using CentOS or similar on EC2, the SSM Agent should be installed, so you should be able to connect by setting up an IAM role.(The EC2 instance must be placed in a public subnet or be able to communicate with Systems Manager via a VPC endpoint.)
https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/access-a-bastion-host-by-using-session-manager-and-amazon-ec2-instance-connect.html
The blank page and SSH connection failure suggest your web server and database services didn't restart after the reboot. Here's how to troubleshoot without SSH access:
Regain Console Access:
Use AWS Systems Manager Session Manager as an alternative to SSH:
Navigate to Systems Manager → Session Manager → Start Session Select your instance and connect This works if your instance has the SSM agent (pre-installed on Amazon Linux 2/2023 and recent Ubuntu AMIs) and an IAM role with AmazonSSMManagedInstanceCore policy attached.
Restart Your Services:
Once connected via Session Manager, check service status:
sudo systemctl status apache2 # or httpd/nginx sudo systemctl status mysql # or mariadb/postgresql Start the services and enable them for automatic startup:
sudo systemctl start apache2 sudo systemctl start mysql sudo systemctl enable apache2 sudo systemctl enable mysql If Session Manager Isn't Available:
If your instance doesn't have SSM agent/role configured, you'll need to:
Stop the instance (not terminate) Detach the root EBS volume Attach it to another EC2 instance as /dev/sdf (In any public subnet to ssh properly for testing ) Mount the volume and check logs in /var/log/ or modify systemd configs to enable services on boot Reattach to original instance and start it Prevent This Issue:
Ensure services start on boot:
sudo systemctl enable apache2 sudo systemctl enable mysql Relevant Documentation:
AWS Systems Manager Session Manager: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html Troubleshoot EC2 Instance Connect: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-troubleshooting.html
Relevant content
- asked 10 days ago
- asked 3 years ago
- AWS OFFICIALUpdated 4 months ago
