🚨 CMMC Phase One started November 10! Here's everything you need to know β†’

How to Configure SSH, RDP and Cloud Console Idle Timeouts for NIST SP 800-171 REV.2 / CMMC 2.0 Level 2 - Control - SC.L2-3.13.9

Step-by-step guidance to enforce idle session timeouts for SSH, RDP and cloud consoles to meet NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 (SC.L2-3.13.9).

β€’
April 15, 2026
β€’
5 min read

Share:

Schedule Your Free Compliance Consultation

Feeling overwhelmed by compliance requirements? Not sure where to start? Get expert guidance tailored to your specific needs in just 15 minutes.

Personalized Compliance Roadmap
Expert Answers to Your Questions
No Obligation, 100% Free

Limited spots available!

NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 control SC.L2-3.13.9 requires that organizations automatically terminate user sessions after a period of inactivity; this post gives practical, small-business-friendly steps to configure idle timeouts for SSH, RDP and common cloud consoles (AWS, Azure, GCP), plus implementation tips, evidence collection and real-world examples you can apply immediately.

Why idle session timeouts matter for Compliance Framework

At a Compliance Framework level, SC.L2-3.13.9 is about reducing the window of opportunity for an adversary to use an unattended or forgotten session to access Controlled Unclassified Information (CUI). For auditors you'll need policy that defines timeout values, technical configurations that enforce them, logs showing enforcement, and an exception process for business needs. Practically, this control ties into access control, session management, and incident prevention across both on-premises and cloud-hosted resources.

SSH (OpenSSH) β€” server and shell-level enforcement

Best practice is to enforce timeouts at two layers: the SSH server (sshd) to drop dead or unresponsive connections, and the user shell to auto-logout idle interactive shells. On Linux servers edit /etc/ssh/sshd_config and set ClientAliveInterval and ClientAliveCountMax to cause sshd to disconnect unresponsive clients after a fixed period. Example: to disconnect after ~15 minutes of inactivity:

ClientAliveInterval 300
ClientAliveCountMax 2

This sends a keepalive every 300 seconds and disconnects after 2 missed replies: ~900 seconds (15 minutes). Additionally, add a shell-level timeout for interactive shells by setting TMOUT in global shell profiles (e.g., /etc/profile.d/timeout.sh):

export TMOUT=900
readonly TMOUT

This logs out bash shells after 900 seconds of inactivity. For systems using other shells (zsh, ksh) set their equivalent idle timeout variables. For bastion hosts or jump boxes, also enable session recording (auditd, audit logs, or a proxy) and consider limiting privileged sessions to Systems Manager Session Manager or similar to centralize timeout control.

RDP (Windows) β€” Group Policy and Intune

Windows RDP session limits are best enforced with Group Policy (GPO) in Active Directory or via Intune for cloud-managed endpoints. In GPO: Computer Configuration β†’ Administrative Templates β†’ Windows Components β†’ Remote Desktop Services β†’ Remote Desktop Session Host β†’ Session Time Limits. Important settings to configure: "Set time limit for active but idle Remote Desktop Services sessions" (e.g., 15 minutes), "Set time limit for disconnected sessions", and "End session when time limits are reached". Example values for a small business: 15 minutes idle, 1 hour disconnected grace period.

For single servers without AD, configure local group policy (gpedit.msc) or set registry keys under HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services. If you manage endpoints with Intune, deploy the same settings through Administrative Templates or a custom OMA-URI policy. Document exceptions where longer sessions are required (with risk acceptance and compensating controls such as restricted source IP or MFA).

AWS, Azure and GCP console sessions β€” use identity/session controls

Cloud consoles are typically controlled by the cloud provider's identity layer (IAM, Azure AD, Google Workspace). For AWS: prefer IAM Identity Center (formerly AWS SSO) or configure role session durations for IAM rolesβ€”set the "Maximum session duration" to a lower value (e.g., 1 hour) and require MFA. For interactive shell access, replace SSH over the open internet with AWS Systems Manager Session Manager and set an IdleSessionTimeout in Session Manager preferences (minutes) to automatically terminate idle sessions.

Azure Portal: use Azure AD Conditional Access session controls and "Sign-in frequency" or the "Idle session sign-out" feature available under Enterprise Applications β†’ User settings β†’ Idle session sign-out (or via Conditional Access | Session controls for supported apps). For RDP to Azure VMs, rely on the same Windows GPO approach inside the VM or use Azure Bastion combined with host-level policies. GCP: control Console sign-in durations via Google Workspace (Admin console β†’ Security β†’ Access and data control β†’ Session length) or configure SAML assertion lifetimes for identity providers; for SSH use IAP or OS Login with enforced token lifetimes and audit logs to detect long-lived sessions.

Practical small-business scenarios and examples

Scenario 1 β€” Small MSP with 10 Linux servers: implement a baseline /etc/ssh/sshd_config with ClientAliveInterval 300 and ClientAliveCountMax 2, push TMOUT=900 via configuration management (Ansible/chef/salt) to /etc/profile.d/timeout.sh, and collect /var/log/auth.log entries via a centralized syslog (or CloudWatch/ELK) for evidence.

Scenario 2 β€” Small Windows shop using Azure AD + Intune: deploy an Intune configuration policy that sets Remote Desktop session limits, enable Azure AD conditional access to require MFA and set sign-in frequency for the Azure portal to 1 hour, and collect event logs from Windows Security/TerminalServices-LocalSessionManager for audit evidence.

Compliance tips, logging and evidence collection

Document the chosen timeout values in your access/session management policy and map them to SC.L2-3.13.9. Collect and retain logs that show session termination events (sshd disconnects, Windows Event IDs 4634/4779/4647, AWS/SSM session termination events, Azure sign-in logs) for your required retention period. Automate attestations: run periodic scans (e.g., CIS Benchmarks, OpenSCAP, AWS Config rules/Azure Policy) to detect drift and produce a report for auditors. Maintain an exceptions register with business justification, compensating controls, and expiration.

Risks of not implementing idle timeouts and mitigation

Failing to implement SC.L2-3.13.9 increases risk of unauthorized access through unattended sessions, credential theft from persistent sessions, and lateral movement after initial compromise. From a compliance standpoint, lack of enforcement and logs can result in audit findings, lost contracts, or remediation orders. Mitigations if you cannot immediately apply timeouts: restrict network access (VPN, IP allowlists), require MFA for all console access, and enable continuous monitoring/alerting for atypical session durations.

In summary, meeting NIST SP 800-171 Rev.2 / CMMC 2.0 Level 2 SC.L2-3.13.9 requires a documented policy, technical controls that enforce idle timeouts across SSH, RDP and cloud consoles, centralized logging for evidence, and an exception process; for small businesses this is achievable quickly by standardizing sshd_config/TMOUT, applying Windows GPOs or Intune profiles, and using cloud identity/session controls (SSO, SSM, Conditional Access) while capturing audit logs for compliance evidence.

 

Quick & Simple

Discover Our Cybersecurity Compliance Solutions:

Whether you need to meet and maintain your compliance requirements, help your clients meet them, or verify supplier compliance we have the expertise and solution for you

 CMMC Level 1 Compliance App

CMMC Level 1 Compliance

Become compliant, provide compliance services, or verify partner compliance with CMMC Level 1 Basic Safeguarding of Covered Contractor Information Systems requirements.
 NIST SP 800-171 & CMMC Level 2 Compliance App

NIST SP 800-171 & CMMC Level 2 Compliance

Become compliant, provide compliance services, or verify partner compliance with NIST SP 800-171 and CMMC Level 2 requirements.
 HIPAA Compliance App

HIPAA Compliance

Become compliant, provide compliance services, or verify partner compliance with HIPAA security rule requirements.
 ISO 27001 Compliance App

ISO 27001 Compliance

Become compliant, provide compliance services, or verify partner compliance with ISO 27001 requirements.
 FAR 52.204-21 Compliance App

FAR 52.204-21 Compliance

Become compliant, provide compliance services, or verify partner compliance with FAR 52.204-21 Basic Safeguarding of Covered Contractor Information Systems requirements.
 
Hello! How can we help today? πŸ˜ƒ

Chat with Lakeridge

We typically reply within minutes