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
- Using Group Policy (for Pro/Enterprise):
- Open the Group Policy Editor: Press
Win + R, typegpedit.mscand 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.
- Open the Group Policy Editor: Press
- Using Registry Editor (for Home/Pro):
- Open Registry Editor: Press
Win + R, typeregeditand 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.
- Open Registry Editor: Press
macOS Auto Log-out
- 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.
- Using the
pmsetcommand (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)
- 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.
- Using
xsetcommand (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).