一個ssh登入緩慢的問題追蹤記錄

來源:互聯網
上載者:User

標籤:ssh

昨天需要ssh登入某伺服器,但ssh登入緩慢,差不多半分鐘才登入成功,故對其進行追蹤檢查

①、ssh ip -vvv 或 ssh ip -v

  用於檢查ssh在哪個位置用時最長

  然後發現在Entering interactive session 語句後等待時間最長,超過20秒,說明非ssh登入時密 碼驗證的問題

②、這樣看不出啥問題,故使用starce進行追蹤

  starce -o ~/starce_ssh.txt -T ssh ip

  cat ~/starce_ssh.txt 發現:

   clock_gettime(0x7 /* CLOCK_??? */, {5243451, 134078578}) = 0 <0.000026>

   select(7, [3], [], NULL, NULL)          = 1 (in [3]) <25.026978>

   然而看不懂這個地方,悲催

③、故嘗試查看所登入的伺服器的messages日誌,竟然有重大發現

  dbus[7782]: [system] Failed to activate service ‘org.freedesktop.login1‘: timed out

  dbus-daemon: dbus[7782]: [system] Failed to activate service ‘org.freedesktop.login1‘:   timed out

   顯示這個服務逾時了,網上尋找資料,大意如下:

   dbus的服務重啟後,systemd-logind服務沒有重啟導致,可以查看systemctl status systemd-logind的狀態,解決方案就是重啟該服務 systemctl restart systemd-logind


參考文檔:http://serverfault.com/questions/707377/slow-ssh-login-activation-of-org-freedesktop-login1-timed-out


一個ssh登入緩慢的問題追蹤記錄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.