Я успешно подключился к экземпляру EC2 следующим образом:
ssh -i .ssh/ec2docker.cer user@SOMEIP
Примерно через час использования экземпляра я ухожу и возвращаюсь еще два часа к этому:
$ packet_write_wait: Connection to xx port 22: Broken pipe
Теперь при попытке подключения вообще ничего не происходит:
OpenSSH_7.9p1, OpenSSL 1.1.1b FIPS 26 Feb 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host xxx originally xxx
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final'
debug2: match not found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host xxx originally xxx
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final'
debug2: match found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug2: resolving "xxxx" port 22
debug2: ssh_connect_direct
debug1: Connecting to xxx [xx] port 22.
debug1: Connection established.
debug1: identity file .ssh/ec2docker.cer type -1
debug1: identity file .ssh/ec2docker.cer-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh не завершается или выдает ошибку. Монитор EC2 показывает, что экземпляр работает с ненулевой загрузкой ЦП (около 25%) и ненулевым чтением и записью по сети.
@Adiii Да, перезапуск экземпляра, и я могу повторно подключиться. Но эта проблема повторяется. Я не могу продолжать перезапускать экземпляр.
это происходит только при остановке EC2 или при более интенсивном процессе ЦП, это основано на моем опыте, вы можете создать тикет на сайте AWS.
также проверьте журнал аудита ssh, почему это происходит
Вы проверили общедоступный IP-адрес вашего EC2 в AWS?
Похоже на перезагрузку и если у вас нет и "эластичного IP", то теперь у вас новый публичный ip.
Экземпляр не перезагружался, и IP-адрес остается прежним. Кстати, эта проблема повторяется - после перезагрузки экземпляра я могу подключиться, но это повторилось.
Сломанная труба означает, что соединение было потеряно
1) Нажмите на экземпляр EC2. 2) Нажимаем подключить 3) Используйте команду для подключения, и она должна работать
Причиной этой проблемы была утечка памяти в приложении, которое я запускал; он задушил весь экземпляр EC2.
Я думаю, что ваш экземпляр маленький или микро, остановите его, а затем запустите, это должно сработать.