Ubuntu 16.04 の sshd - ログインに非常に時間がかかります

Ubuntu 16.04 の sshd - ログインに非常に時間がかかります

これまで何度も、ssh ログインに数秒かかるのを見てきました。私はいつもそれが不適切だと思っていました。ワークステーションを Xubuntu 16.04 に再インストールした後、この影響は本当に混乱を招きました。同じ LAN 内の 2 つのワークステーション間では、ssh ログインに 10 秒以上かかります。その後は、すべてが高速です。

マシンは、ルーター経由で DNS を介してすぐに互いを見つけることができます。ただし、 も試しましたUseDNS no。WebGSSAPIAuthentication noで見つけた方法も試しました。どちらも効果がありませんでした。

公開鍵で認証します。

これは、ssh クライアントからのデバッグ出力の一部です。

debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/pino/.ssh/ids/heisterkamp/22/pino
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug2: input_userauth_pk_ok: fp XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
debug3: sign_and_send_pubkey: RSA XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to heisterkamp ([fd00::8d93:c17b:595a:347f]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: exec

今、この物体は 10 秒間「スリープ」状態にあります。その後、次のように続きます。

debug1: client_input_global_request: rtype [email protected] want_reply 0
debug3: receive packet: type 91
debug2: callback start
debug2: x11_get_proto: /usr/bin/xauth  list :0.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 1
debug3: send packet: type 98
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IPV6_TCLASS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
...

待機時間の理由が分かる人はいますか?

編集: 言及する価値のある詳細がいくつかあります:

  • 自分のワークステーションを使用して同じネットワーク内の他の Debian マシンにログインする場合、かかる時間はわずか 1 秒です。
  • ログイン時に luks で暗号化されたボリュームをマウントするように pam_mount を設定しました。ただし、私の状況では、このボリュームはすでにマウントされています。また、マウント解除されている場合でも、マウントには約 3 秒しかかからないはずです。

答え1

同じ問題です。10 秒の遅延後に次のメッセージが表示されることに注意してください: "サービス 'org.freedesktop.login1' の有効化に失敗しました: タイムアウトしましたauth.log の "

解決:

systemctl restart systemd-logind

それを見つけたここ

答え2

私の場合、これにより「debug1: pledge: exec」でハングする問題が解決しました。

apt install --reinstall systemd

関連情報