關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 設定終止閒置 SSH 連線的時間

    Posted on June 14th, 2007 Sam Tang No comments

    基於安全的理由,如果用戶連線到 SSH Server 後閒置,SSH Server 會在超過特定時間後自動終止 SSH 連線。以下是設定終止連線時間的方法:

    1. 開啟 /etc/ssh/sshd_config 檔案,裡面有一個參數為 ClientAliveCountMax,它是設定用戶端的 SSH 連線閒置多長時間後自動終止連線的數值,單位為分鐘。

    2. 如果這一行最前面有 # 號,將那個 # 號刪除,並修改想要的時間。

    3. 修改後儲存及關閉檔案,重新啟動 sshd:

    # /etc/rc.d/init.d/sshd restart

    # /etc/init.d/ssh restart


    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word