数秒間、クライアントがサーバーに ssh できません
Environment
Red Hat Enterprise Linux 3、4、および 5
Issue
クライアントがサーバーに ssh できず、以下のメッセージが表示されます。
ssh_exchange_identification:Connection closed by remote host
Couldn't read packet:Connection reset by peer
ssh サーバーの /var/log/secure ファイルには何も記録されていません。
Resolution
多数のクライアントが ssh サーバーに接続しているかどうかを確認します。
デフォルトでは、認証されていない接続が sshd デーモンに同時接続できる最大数を ssh サーバーが指定します。認証が成功するまでもしくは接続に対する LoginGraceTime の有効期限が切れるまで追加接続要求はドロップされます。デフォルト値は 10 です。
ssh サーバーの負荷が高い場合は、/etc/ssh/sshd_config の "MaxStartups" パラメータを変更します。
パラメータ変更後は sshd の再起動が必要です。
#vi /etc/ssh/sshd_config
...
MaxStartups 20
...
#service sshd restart
Diagnostic Steps
-
/etc/hosts.deny などでファイアウォールなどの制限ルールが存在するかどうか確認します。
-
ssh クライアントの /var/log/secure にレコードが存在するかどうか確認します。
-
設定に最近追加した変更はありますか?
コメント
類似した問題があります。詳細については、Why did RHEL server stop accepting logins? を参照してください。
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
