ssh問題

問題服務器

ssh遠程鏈接服務器及其緩慢,重啓重裝sshd無濟於事session

用ssh -vvv  發登陸慢是卡在下面這步:ssh

debug1: Entering interactive session.debug

後發如今執行機上systemd-logind致使cpu 100%的問題,使得登陸異常緩慢,而且消耗資源。對象

緣由
systemd-logind主要功能是爲每個登錄session建立一個systemd角度的cgroup管理對象,更方便對session使用cgroup,在實際場景中沒有什麼用處,關閉不會影響正常ssh登錄
在有crond任務時,觸發systemd-logind回收不及時的bug
解決辦法
關閉或重啓systemd-logind資源

systemctl stop systemd-logindio

 

 

 

ssh取消超時斷開登錄

 編輯/etc/ssh/sshd_configfile

ClientAliveInterval 60
ClientAliveCountMax 3bug

 

編輯/etc/profile

添加 TMOUT=0

爲0就是設置不超時

相關文章
相關標籤/搜索