Other Articles

Servers – Configure /tmp Partition

Support > Fixing Checks > Server

02 March, 2026

This check ensures that the /tmp directory is configured with secure mount options. The /tmp directory is used for temporary file storage and is accessible by all users. Without proper restrictions, attackers may exploit this directory to execute malicious programs or escalate privileges.

Check Details

  • Resource: Server
  • Check: Verify Presence of Tmp Partition
  • Risk: If the /tmp directory is not mounted with security options such as noexec, nodev, and nosuid, attackers may run malicious executables, create device files, or escalate privileges through temporary files.

Remediation Steps

  1. Open a terminal session on the target server with root or sudo privileges.
  2. Edit the systemd configuration for the tmp.mount unit.

    sudo systemctl edit tmp.mount
    
  3. Edit the configuration to define secure mount options for the /tmp filesystem.

    [Mount]
    Options=mode=1777,strictatime,noexec,nodev,nosuid
    
  4. Reload the systemd daemon to apply the configuration changes.

    sudo systemctl daemon-reload
    
  5. Restart the tmp.mount service so the new mount options take effect.

    sudo systemctl restart tmp.mount
    

Note: On Container-Optimized OS, the /etc directory is stateless. Changes made to configuration files may not persist across system reboots. If persistence is required, configure these settings using OS-specific startup scripts or configuration management tools.