Skip to content

Terminal in Linux on remote laptop keeps hanging while I am sshed into EC2 Instance

1

How do I resolve this issue as my terminal on linux keeps hanging while I am sshed into the aws subscribed g4dn.4xlarge EC2 instance.

asked a year ago236 views
2 Answers
1

Hello.

Does the same phenomenon occur with connection methods other than SSH?
For example, will it become impossible to operate even if I connect with Systems Manager Session Manager?
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html

By the way, when using VSCode's RemoteSSH, a phenomenon may occur that consumes a large amount of memory.
https://github.com/microsoft/vscode/issues/203425

EXPERT
answered a year ago
EXPERT
reviewed a year ago
AWS
EXPERT
reviewed a year ago
  • Hi. I have not tried to connect with methods other than ssh. I am just worried if I have configured the network settings for my instance wrongly and that is causing the hanging issue quite regularly.

  • Check the system logs and sshd logs when SSH was hung to see if any errors have occurred.

0

Hi

There can be a few reasons why your terminal hangs while SSH into your EC2 instance.

Check the SSH Connection:

Verbose Logging: Use the ssh -vv flag to get more detailed information about the connection process. This might reveal errors during the initial handshake or key exchange.

Security Group Rules: Verify that your security group allows SSH access on port 22 from your local machine's IP address. You can check and modify security groups in the AWS Management Console.

AWS Documentation: The AWS documentation has detailed information on troubleshooting SSH connections to EC2 instances https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html.

Stack Overflow: Stack Overflow is a great resource for troubleshooting Linux and AWS related issues. Search for "SSH hangs EC2" to find solutions from other users https://stackoverflow.com/questions/50925384/ssh-hangs-when-attempting-to-connect-to-amazon-aws-ec2-instance.

EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.