GNU/Linux >> Linux の 問題 >  >> Cent OS

rsyslog サーバーに到達できないため、SSH ログインが遅い

問題

先週、サーバーへの SSH が遅すぎるという厄介な問題に直面しました。 Linux サーバーへの SSH に 30 秒から 1 分程度の長い時間がかかっていました。 SSH が以下のプロンプトでスタックし、30 秒間パスワードを入力するオプションがなく、パスワード プロンプトが表示されましたが、パスワードを入力しても何も進みません。

# ssh -vvv [server_ip_address]
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug3: cipher ok: arcfour [arcfour,aes128-ctr,aes192-ctr,aes256-ctr]
debug3: cipher ok: aes128-ctr [arcfour,aes128-ctr,aes192-ctr,aes256-ctr]
debug3: cipher ok: aes192-ctr [arcfour,aes128-ctr,aes192-ctr,aes256-ctr]
debug3: cipher ok: aes256-ctr [arcfour,aes128-ctr,aes192-ctr,aes256-ctr]
debug3: ciphers ok: [arcfour,aes128-ctr,aes192-ctr,aes256-ctr]
debug2: mac_setup: found hmac-sha1
debug3: mac ok: hmac-sha1 [hmac-sha1]
debug3: macs ok: [hmac-sha1]
...
debug1: Found key in /root/.ssh/known_hosts:36
debug2: bits set: 1063/2048
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: Wrote 16 bytes for a total of 813
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug3: Wrote 52 bytes for a total of 865
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received

解決策

構成ファイル /etc/rsyslog.conf で定義されている rsyslog サーバー エントリが間違っているか、到達できない rsyslog サーバーがある場合、Linux サーバーへの SSH ログインが遅延または低速になることがあります。 .この問題を解決するには、rsyslog サーバーが rsyslog クライアントから常に到達可能であることを確認してください。または、回避策として、クライアント側で rsyslog 構成ファイル /etc/rsyslog.conf を編集し、rsyslog に関連するすべての参照をコメントアウトします。

1. たとえば、ファイル /etc/rsyslog.conf を編集して、3 行以下をコメントアウトします。

# vi /etc/rsyslog.conf
#*.* @@xxx.xxx.xxx.xxx:514
#daemon.*;daemon.!info /var/log/messages
#local0.info /var/log/asmaudit.log

2. rsyslog サービスを再起動します。

# service rsyslog restart        # CentOS/RHEL 6
# systemctl restart rsyslog      # CentOS/RHEL 7
注意 :rsyslog 構成ファイルが変更された場合は、rsyslog サービスを再起動する必要があります。

結論

sshd サービスは、ログインの試行やその他の有益なログを syslog ファイルに記録しようとしますが、その間にシステムに負荷がかかっていたり、syslog サービスに何らかの問題が発生したりすると、要求がタイムアウトするまで接続が遅延します。これは、rsyslog サーバーとの接続の問題を解決するか、到達できない rsyslog サーバーを参照する行をコメントアウトすることで回避できます。


Cent OS
  1. パスワードレスログインSSH– CentOS 6 / RHEL 6

  2. CentOS7で集中型Rsyslogサーバーをセットアップする

  3. SSHログイン

  1. サーバーへの SSH 経由の直接ルート ログインとユーザー アクセスを無効にする

  2. [修正済み] OpenSSH が遅い:SSH2_MSG_SERVICE_ACCEPT の受信時にハングする

  3. CentOS/RHEL 6,7 で監査ログをリモート Rsyslog サーバーに送信する方法

  1. DebianLinuxServerでSSHルートログインを有効にする

  2. SSHのトラブルシューティング

  3. Amazon Linux AMI で SSH のパスワード ログインを有効にする