Other Articles

Servers – Ensure SSH Idle Timeout Interval is Configured

Support > Fixing Checks > Server

06 March, 2026

This check ensures that SSH idle timeout interval is properly configured on the server.

Without an idle timeout, inactive SSH sessions may remain open indefinitely, increasing the risk of unauthorized access if a session is left unattended.

Check Details

  • Resource: Server
  • Check: Ensure SSH idle timeout interval is configured
  • Risk: Unattended SSH sessions may allow unauthorized access if not automatically terminated.

Remediation Steps

  1. Open a terminal session with root or sudo privileges.
  2. Verify current SSH idle timeout configuration:

    sshd -T | grep -i clientalive
    
  3. Ensure:

    ClientAliveInterval is set between 1 and 300
    ClientAliveCountMax is set to 3 or less
  4. Edit SSH configuration file:

    sudo nano /etc/ssh/sshd_config
    
  5. Add or modify the following lines:

    ClientAliveInterval 300
    ClientAliveCountMax 0
    
  6. Save the file and exit.
  7. Restart SSH service:

    sudo systemctl restart sshd
    
  8. Re-run the audit command to confirm configuration.
  9. Perform regular audits to ensure compliance.