Other Articles

Servers – Ensure Default User Shell Timeout is 900 Seconds or Less

Support > Fixing Checks > Server

06 March, 2026

This check ensures that default user shell timeout (TMOUT) is set to 900 seconds or less.

The TMOUT variable defines the idle timeout for shell sessions. Setting this value helps automatically log out inactive users and reduces the risk of unauthorized access.

Check Details

  • Resource: Server
  • Check: Ensure default user shell timeout is 900 seconds or less
  • Risk: Without a timeout, inactive sessions may be misused by unauthorized users, increasing security risk.

Remediation Steps

  1. Open a terminal session on the server with root or sudo privileges.
  2. Check the current TMOUT value in system files:

    grep "^TMOUT" /etc/bash/bashrc
    grep "^TMOUT" /etc/profile
    
  3. Open the configuration files for editing:

    sudo vi /etc/bash/bashrc
    sudo vi /etc/profile
    
  4. Add or update the following line in both files:

    TMOUT=900
    readonly TMOUT
    export TMOUT
    
  5. Save the files and exit the editor.
  6. Apply changes by reloading the profile:

    source /etc/profile
    
  7. Verify the configuration by re-running the audit commands.
  8. Ensure similar configurations are applied to other shells if used in your system.