Disable automatic screen lock in Ubuntu 18.04

By default Ubuntu will lock your desktop automatically after screen blank off, below steps will show you how to disable it.

Method 1 : Via GUI

1.On your top left of your screen , click the Activities button , then search “privacy” and open it

2.On the right part ,click the “screen lock” , then you can disable the automatic screen lock

Methond 2 : Via commands

1.Open a terminal, run below command to check the status of automatic screen lock , true means enabled ,false means disabled

gsettings get org.gnome.desktop.screensaver lock-enabled

2.Then you can use below command to disable it

gsettings set org.gnome.desktop.screensaver lock-enabled false

3.In case of you want to enable it again , you can run below command

gsettings set org.gnome.desktop.screensaver lock-enabled true

Reset forgotten password in Ubuntu

  1. Power on your computer
  2. Press and hold your left SHIFT key , this will bring you into the grub menu
  3. After going into grub , press “e” to edit the boot command

4.Scroll down and find the line starts with “linux /boot/vmlinuz” and add “init=/bin/bash” to the end of this line , you can refer screenshot below

5.Press F10 to boot
6.Now you enter the command line, here can you run below command to remount the “/”

mount -rw -o remount /

and use below command to reset your password.(if you also forget your username ,try command “ls /home”)

passwd USER

7.If you are prompted with message like “password updated successfully” , you can reboot your computer by pressing Ctl+Alt+Del