How to automatically log out of your Mac after a set period of inactivity

Discover how to protect your user account settings and privacy by setting your Mac to automatically log you out after a set period of inactivity.

iMac on User Lock Screen

You can create multiple user accounts on your Mac, allowing guests and household members to share the same computer without mixing up files or compromising privacy.

Now, if you do share your Mac with others, you might choose to log out (Apple icon  > Log Out name) each time you are done using it to prevent accidental changes or deletions. However, if you don’t plan to be away for long or forget to log out, you could risk losing important files.

To avoid this, we’ll show you how to set your Mac to automatically log out the current user after a period of inactivity.

Automatically log out of Mac when inactive

  1. Open System Settings and select Privacy & Security.
  2. Click Advanced in the bottom right corner.
  3. Turn on the switch next to “Log out automatically after inactivity” and enter your computer password or authenticate via Touch ID.
  4. Next, enter the number of minutes you want your computer to log out after and hit Done.
Log out Mac user automatically after 30 minutes of inactivity

On older versions of macOS

  1. Open the System Preferences and select Security & Privacy.
  2. Click the padlock in the bottom left and enter your password.
  3. Hit the Advanced button. You can do this from any of the tabs within Security & Privacy.
  4. Check the box for Log out after [X] minutes of inactivity and enter the number of minutes in the box.
  5. Click OK and then hit the padlock to re-lock your settings or simply exit.
Mac Automatically Logout When Inactive

Require a password to wake your Mac

If you prefer not to completely log out of your Mac when you’re inactive, you can enable a setting that requires your password after your Mac sleeps or the screen saver starts. This is a helpful setting if you know you’ll be coming back to your Mac and no one else will be using it in the meantime but want that extra security.

  1. Go to System Settings and select Lock Screen from the left sidebar.
  2. Click the drop-down menu next to “Require password after screen saver begins or display is turned off” and select a time frame from Immediately up to 8 Hours or Never.
Require password after screen saver begins or display is turned off settings on Mac

Important: The “Require password after screen saver begins or display is turned off” section will be grayed out, and you can’t change it if iPhone Mirroring is set to “Authenticate automatically.” You can go to iPhone Mirroring settings and set it to “Ask every time” to change the mentioned setting.

iPhone Mirroring settings on Mac

On older versions of macOS

  1. Go to System Preferences > Security & Privacy like above.
  2. This time, click the General tab and unlock the settings.
  3. At the top, check the box for Require password [time] after sleep or screen saver begins and select a time frame from the drop-down box.
Mac Require Password When Inactive

When you work from home and share your Mac with others, or even if you do so in a physical office, making sure that your items stay safe is important.

Are you planning to use the automatic logout setting on your Mac, or will you opt for requiring a password after a short time instead? Let us know!

Other useful Mac tips: