# Ensure Default User Shell Timeout Is Configured

- Source: https://support.icompaas.com/support/solutions/articles/62000235480-ensure-default-user-shell-timeout-is-configured
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Amazon Linux 2 Benchmark v3.0.0](https://support.icompaas.com/support/solutions/62000112696) › [CIS Amazon Linux 2 Benchmarks](https://support.icompaas.com/support/solutions/folders/62000169265)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:** • Level 1

**Description:**  
 Configuring a shell timeout automatically logs out users after a period of inactivity. This reduces the risk of unauthorized access through unattended sessions.

**Rationale:** Setting a shell timeout helps protect the system by minimizing the window where an unattended session could be exploited.

**Impact:** Pros:

-   Enhances security by reducing idle session risks.  
    
-   Supports compliance with security policies.  
    

Cons:

-   May inconvenience users if the timeout is too short.  
    

**Default Value:** Shell timeouts are often not configured by default and need explicit setting.

**Pre-requisites:**

-   Root or sudo privileges to modify shell environment settings.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

1.  Check if shell timeout variables like TMOUT are set globally, for example:  
    
    grep TMOUT /etc/profile /etc/bashrc /etc/bash.bashrc ~/.bashrc ~/.bash\_profile
    
2.  Verify the timeout value is configured.  
    

### **Implementation Plan:**

**Using Linux command line:**

1.  Set shell timeout by adding or updating TMOUT in global shell configuration files (e.g., /etc/profile)  
    
    echo "export TMOUT=900" >> /etc/profile
    
2.  Inform users to re-login or source the configuration for changes to take effect.  
    

### **Backout Plan:**

**Using Linux command line:**

1.  Remove or comment out TMOUT settings if needed.
    
2.  Verify user sessions behave as expected.  
    

**References:**

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   Bash Manual - TMOUT

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
