【AWS】【TroubleShooting】EC2实例无法使用SSH远程登陆(EC2 failure for SSH connection)
1. Login AWS web console and check the EC2 instance.
2. check tag "monitoring" to identify if it is the problem with networking
3. If it is the problem with network, it mostly related to VPC or Security Group, but if this is on production system, it is slim change to have the problem with VPC, but we need to check it firstly
Use CIDR to change the configuration of VPC or check if the IP of EC2 instance is using the same subnet.
4. Check Security Group, if the security group allow the "Inbound" or "Outbound"
For SSH connection, port 22 has to be opened.
For command ping, protocol IMCP should be enabled.
5. If everyting is good from AWS side, we should check the EC2 instance for next steps. If you enable the Detail Monitoring of the server, you can check logs without login server.
6. connect to EC2 to check the status with terminal or web terminal
7. check the SSH service status and the port 22
8. check the SSH log under /var/log/message and /var/log/secure
9. Trouble shooting with command tcpdump to capture the network traffice of port 22
10. Trouble shooting with command strace or gdb to find out what is SSH service doing.