How to Enable Automatic Screen Lock In Ubuntu Linux
- 12 steps
- Needs administrator rights
Automatic screen lock in Ubuntu Linux secures your session after a set period of inactivity, so nobody can see your files when you step away. Ubuntu locks your screen after 5 minutes by default. You can change that timer or turn the feature off in System Settings. The steps below use the default GNOME desktop that ships with Ubuntu. Changes apply immediately, and you don’t need to restart or log out.
Open Settings, go to Privacy (named Privacy & Security on Ubuntu 24.04) and click Screen, then switch Automatic Screen Lock on or off. Ubuntu locks after 5 minutes by default, and you can pick a different delay from the drop-down list. Changes apply immediately, with no restart or administrator rights needed. Press Super+L to lock at any time.
How to turn on or off automatic screen lock in Ubuntu Linux
Automatic screen lock protects your computer from unauthorized access by locking the desktop after a period of inactivity. You can turn it on or off from the main system settings. That keeps your files private when you walk away from your desk, and you can set the idle time to fit how you work. It is worth turning on for laptops, shared offices and any machine that sits in a public space.
When Ubuntu sees no keyboard, mouse or touch activity for the time you set, it locks the screen. Whoever sits down next must enter your password before they can see your desktop or open your files. Your open applications keep running behind the lock screen, so downloads and background jobs are not interrupted.
Here’s how to turn it on or off in Ubuntu Linux. You don’t need administrator rights, because this is a per-user setting.
Ubuntu keeps most of its configuration in one place. System configuration, user accounts and updates all live inside the System Settings panel. The lock settings are in there too, so that is where you need to go.
There are two ways to open System Settings. The first is through the Activities overview.
- Click Activities in the top-left corner of the screen, or press the Super (Windows) key. The overview opens with a search box.
- Type Settings. The Settings app appears in the results.
- Click the Settings icon to open it.

The second way is from the System menu, which is quicker if you already have a desktop window in front of you.
- Click the System menu in the top-right corner of the top bar. It holds the network, volume and power icons, and a panel drops down when you click it.
- Select Settings from the panel, as highlighted below. The Settings app opens.

- In the Settings app, click the Privacy tile in the sidebar. The privacy options open in the main pane.
On newer Ubuntu releases, such as 24.04, this entry is named Privacy & Security. It is the same section with a longer name.

- In the Privacy settings, click Screen. The screen lock options open.
- Find the Automatic Screen Lock switch and click it to turn it On or Off. When it is on, the switch is colored and sits to the right.
To undo the change later, come back to this panel and flip the switch the other way.
- If you turned the lock on, open the Automatic Screen Lock Delay drop-down list.
- Pick how long Ubuntu should wait before it locks the screen. The choice is saved as soon as you select it.

When the screen is locked, you first need to dismiss the lock curtain to get to the password prompt.
- Press the Esc key, or swipe up from the bottom of the screen with your mouse. The password box appears.
- Enter your password and press Enter. Your desktop returns exactly as you left it, with your windows still open.
You don’t have to wait for the timer. Press Super+L at any time to lock the screen at once when you leave your desk.
The display will now lock itself after the timeout you chose. To test it, leave the machine idle for that period and check that the lock screen appears. If it doesn’t, go back to the Screen panel and confirm the switch is still on.
Locking your screen automatically takes the guesswork out of physical security:
- An automatic screen lock is a basic security feature. It protects your computer from unauthorized access when you forget to lock it yourself.
- Ubuntu Linux manages the automatic screen lock through the System Settings panel, under Privacy (or Privacy & Security on newer releases).
- You can customize the feature by toggling the Automatic Screen Lock switch and setting the lock delay to suit your preferences and security needs.
- Remembering to lock your screen by hand is easy to forget. With automatic screen lock, your system is protected whenever it sits idle.
Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!