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

Find out how to prevent accidental changes or people snooping around by setting your Mac to automatically log out of your user account if you have been inactive for a while.

iMac on User Lock Screen

You can add multiple user accounts to your Mac so that other people in your family can use the same computer without each other’s files mixing up or privacy being breached.

Now, if you have done that and share your Mac with others in your home and you’re going to take a break, you might log out (Apple icon > Log Out name). This helps to prevent someone from accidentally changing or deleting things you’re working on. But if you don’t plan to be gone long or simply 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 you out if you’re inactive for a period of time.

Related: How to secure your Mac and all of its valuable data (18 tips)

Automatically log out of Mac when inactive

  1. Open System Settings.
  2. Select Privacy & Security.
  3. Click Advanced from the bottom right corner.
  4. Turn on the switch next to “Log out automatically after inactivity” and enter your computer password or authenticate via Touch ID.
  5. 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 on 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 log out of your Mac completely when you’re inactive, there’s another setting you might try. This requires you to enter your password after your Mac sleeps or the screen saver starts. 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, this is a helpful setting.

  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

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 going to use the automatic logout setting on your Mac? Or maybe you’ll opt for requiring a password after a short time instead? Let us know.

Useful Mac tips: