# Ensure sudo Authentication Timeout Is Configured Correctly

- Source: https://support.icompaas.com/support/solutions/articles/62000235540-ensure-sudo-authentication-timeout-is-configured-correctly
- 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:  
 The sudo authentication timeout controls the duration a user can execute sudo commands without re-entering their password. Configuring this timeout correctly balances usability with security by limiting the window for unauthorized privileged access.

Rationale:  
 A properly configured timeout reduces the risk of unauthorized use of sudo privileges while minimizing frequent password prompts for legitimate users.

Impact:  
 Pros:

-   Enhances security by requiring timely re-authentication.  
    
-   Supports user convenience by allowing brief password caching.  
    

Cons:

-   Setting too short a timeout may inconvenience users.  
    
-   Setting too long a timeout may increase security risks.  
    

Default Value:  
 Defaults vary; often the timeout is set to 5 minutes.

Pre-requisites:

-   Root or sudo privileges to modify sudoers configuration.  
    

Remediation:

### Test Plan:

Using Linux command line:

1.  Check sudoers configuration for timestamp\_timeout:  
    
    sudo grep timestamp\_timeout /etc/sudoers /etc/sudoers.d/\*
    
      
    
2.  Verify the timeout value is appropriate (e.g., between 0 and 15 minutes).  
    

### Implementation Plan:

Using Linux command line:

1.  Edit sudoers file safely using visudo:  
    
    visudo
    
      
    

2.  Set or update the timestamp\_timeout directive, for example:  
    
    Defaults timestamp\_timeout=5
    
      
    
3.  Save changes.  
    

### Backout Plan:

Using Linux command line:

1.  Modify timestamp\_timeout value as needed to previous or different values.
    
2.  Verify sudo authentication behavior.  
    

References:

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   sudoers Manual  
    
-   [NIST SP 800-53 Revision 5 - AC-6  
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#ac-6)

## 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.
