GNOME, the default desktop of Ubuntu, Fedora, CentOS and Debian, by default turns off and locks screen after system idle for a few minutes. You may however don’t want to type user password every time to activate it from blank screen.
It’s possible to disable automatic screen lock when system is going to blank screen, and even remove the “Lock” option from top-right corner system menu. So the user is not able to lock his (or her) screen.
Disable Automatic Screen Lock When idle:
The gnome-control-center (System Settings) has ability to toggle automatic screen lock when system inactivity for a period of time. You can do following steps to turn the function off.
Firstly, open System Settings either from top-right system tray menu, or by searching for and opening it from the Activities overview screen.
When it opens, go to Privacy from the left pane and then navigate to Screen Lock. And turn off the slider icon to disable the function. As well, you may disable screen lock on suspend for Ubuntu.
Disable Lock option from top-right system tray menu:
It’s possible to prevent user from manually lock the screen using the system tray menu option, either via a single command or using a graphical configuration tool.
1. Single command to hide the Lock screen option
Click on top-left ‘Activities’ or press Windows (Super) key on keyboard to bring up the overview screen. Then search for and open terminal.
When terminal opens, copy and paste the command below into it and hit Enter will do the trick:
gsettings set org.gnome.desktop.lockdown disable-lock-screen true
To restore the change, run the command to reset the key:
gsettings reset org.gnome.desktop.lockdown disable-lock-screen
2. Disable lock option via Dconf Editor:
For those hate Linux command, you can search for and install Dconf Editor from Ubuntu Software (Gnome Software):
Then search for and open the tool from Activities overview screen, and navigate to “/org/gnome/desktop/lockdown“. There find out the “disable-lock-screen” key and turn off the slider icon will hide the menu option from system menu.
That’s all. Enjoy!