Open augustfeng-vention opened 3 months ago
Thanks for reaching out. Have you tried increasing your ServerAliveCountMax
value to address this? I'll also share EC2 documentation on addressing connection timeout issues: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout
The code you referenced is maintained by a customization owner on another team so I'll also reach out to them for feedback on this request.
Np. I currently have this in my ~/.ssh/config
file to make things work:
Host *
ServerAliveCountMax 3
Describe the bug
When I use the
ec2-instance-connect
command, the ssh connection disconnects after 5 second of inactivity.Expected Behavior
I expect it to wait for a longer idle time before disconnectcing.
Current Behavior
The ssh connection times out after 5 seconds of inactivity.
Reproduction Steps
Possible Solution
There's a configuration for the ServerAliveInterval in ssh.py for 5 seconds.
My MacOS's /etc/ssh/ssh_config file contains the following configuration:
The short ServerAliveInternal option from the AWS CLI doesn't work too well with MacOS's default
ServerAliveCountMax 0
.Can we either remove it, or configure the
ServerAliveCountMax
alongside it?Additional Information/Context
No response
CLI version used
aws-cli/2.17.13 Python/3.11.9 Darwin/23.5.0 exe/x86_64
Environment details (OS name and version, etc.)
Sonoma 14.5 (Apple M3 Pro)