Get a Pentest and security assessment of your IT network.

Cyber Security

Desktop Auto Log-out: A Step-by-Step Guide

TL;DR

This guide shows you how to automatically log users out of desktop computers after a period of inactivity. This improves cyber security and protects sensitive data. We’ll cover methods for Windows, macOS, and Linux.

Windows Auto Log-out

  1. Using Group Policy (for Pro/Enterprise):
    • Open the Group Policy Editor: Press Win + R, type gpedit.msc and press Enter.
    • Navigate to: Computer Configuration > Administrative Templates > System > Logon.
    • Double-click “Enable automatic logoff”.
    • Set it to “Enabled” and enter the inactivity time in minutes (e.g., 30 for 30 minutes).
    • Click Apply, then OK.
  2. Using Registry Editor (for Home/Pro):
    • Open Registry Editor: Press Win + R, type regedit and press Enter.
    • Navigate to: HKEY_CURRENT_USERControl PanelDesktop
    • Double-click “IdleTimeOut”. If it doesn’t exist, right-click in the right pane, select New > DWORD (32-bit) Value and name it “IdleTimeOut”.
    • Set the value data to the inactivity time in seconds (e.g., 1800 for 30 minutes). Base should be Decimal.
    • Restart your computer for the changes to take effect.

macOS Auto Log-out

  1. Using Energy Saver Settings:
    • Open System Preferences > Battery (or Energy Saver on older macOS versions).
    • Click the “Battery” or “Power Adapter” tab.
    • Adjust the “Turn display off after” slider to your desired inactivity time. This will also lock the screen, effectively logging the user out if they don’t re-authenticate.
  2. Using the pmset command (Advanced):
    • Open Terminal (Applications > Utilities).
    • To set auto log-out after 30 minutes on battery:
      sudo pmset -a idlelogout 1800
    • To set auto log-out after 60 minutes when plugged in:
      sudo pmset -b idlelogout 3600

Linux Auto Log-out (GNOME Desktop)

  1. Using GNOME Settings:
    • Open Settings > Power.
    • Under “Automatic Screen Blank”, set the “Blank screen after” time to your desired inactivity period. This will lock the screen, requiring a login.
    • You may also need to adjust settings in “Screen Lock” for automatic locking behaviour.
  2. Using xset command (Alternative):
    • Open Terminal.
    • To set auto log-out after 30 minutes:
      xset s noblank dpms force off 1800
    • Add this command to your startup applications so it runs automatically when you log in. The exact method for doing this varies depending on your Linux distribution (e.g., using the “Startup Applications” tool).
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation