How to Disable Kali Linux Auto Logout (Screen Lock) After Inactivity


If you use Kali Linux a lot - especially for penetration tests, CTFs, or long-running tools and scans - you may have encountered this annoying situation:
You leave for a while and come back to ...... Then “bang” - the screen is locked or your session is logged out.
This automatic logout or screen lock behavior is for security purposes, but it can become frustrating when you're working in a controlled environment or running a long unsupervised task.
Here's how I deactivated Kali Linux's auto-logout/screen-lock behavior - and made my workflow smoother.
Disable Auto Logout in Kali Linux
Kali defaults to XFCE now, so we’ll cover that first.
For XFCE desktop
Open xfce screensaver. Search for “screensaver” in application search box.
Disable screensaver. Toggle the switch to turn it off. If it blue, it means, it’s turned on.
Disable Lock Screen as well. Click on the “Lock Screen” greyed out button and disable it.
(Optional) Open Power Manager. Again, search for “power manager” in application search box.
Switch to DIsplay tab and disable “Display Power Management” for both- On battery and Plugged in state.
For Gnome Desktop
If you’re using the GNOME environment instead:
gsettings set org.gnome.desktop.session idle-delay 0
gsettings set org.gnome.desktop.screensaver lock-enabled false
idle-delay is in seconds (0 disables it).
Bonus: Disable via Terminal (XFCE)
For script automation or SSH:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lock-screen-suspend-hibernate -s false
Disabling screen lock is not recommended in public or shared environments.
Use this configuration only in private labs, VMs, or trusted setups.
After doing this, my sessions no longer lock, and long-running scripts or exploits don’t get interrupted. I still retain manual control to lock the screen if needed (Ctrl+Alt+L
).
Subscribe to my newsletter
Read articles from Bhuwan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
