Ssh

ssh 到 debian 11 需要將近 2 分鐘

  • March 10, 2022

這就是我在系統日誌中看到的 - ssh 正在使用私鑰完成。2 分鐘後 - 登錄成功。

Feb  8 10:01:53 systemd[1]: Starting User Manager for UID 0...
Feb  8 10:01:53 systemd[34555]: gpgconf: error running '/usr/lib/gnupg/scdaemon': probably not installed
Feb  8 10:03:23 systemd[1]: user@0.service: Main process exited, code=exited, status=1/FAILURE
Feb  8 10:03:23 systemd[1]: user@0.service: Killing process 34555 (gpgconf) with signal SIGKILL.
Feb  8 10:03:23 systemd[1]: user@0.service: Killing process 34556 (awk) with signal SIGKILL.
Feb  8 10:03:23 systemd[1]: user@0.service: Killing process 34561 (dirmngr) with signal SIGKILL.
Feb  8 10:03:23 systemd[1]: user@0.service: Killing process 34555 (gpgconf) with signal SIGKILL.
Feb  8 10:03:23 systemd[1]: user@0.service: Killing process 34556 (awk) with signal SIGKILL.
Feb  8 10:03:23 systemd[1]: user@0.service: Killing process 34561 (dirmngr) with signal SIGKILL.
Feb  8 10:03:23 systemd[1]: user@0.service: Failed with result 'exit-code'.
Feb  8 10:03:23 systemd[1]: user@0.service: Unit process 34561 (dirmngr) remains running after unit stopped.
Feb  8 10:03:23 systemd[1]: Failed to start User Manager for UID 0.
Feb  8 10:03:23 systemd[1]: Started Session 14 of user root.

/etc/pam.d/common-session

#session 可選 pam_systemd.so

將解決這個問題。

我解除安裝了導致問題的包gpg-agentdirmngr 。

我不知道它們是自動安裝的還是作為依賴項安裝的,但我的系統不需要它們。

這不是每個人的解決方案,所以我不想在這裡寫一個刪除包的命令。

引用自:https://serverfault.com/questions/1093036