Secure your X Window System

July 12, 2007 at 6:55 pm | Posted in Security, X windows | Leave a comment

The Problem

What will you do when you leave your X Window desktop on a Linux box?
obviously, lock it to protect your precious data. But this is not a full protection yet, why? because one can still press <Ctrl> + <Alt> + BackSpace key to kill your entire session. If you have any unsaved documents they all are gone.

The Solution

Open /etc/X11/xorg.conf file in your favorite text editor and look for
Section “ServerFlags” line. If one already exists add the following line between start and end of that section.

    Option "DontZap"      "true"

If the section does not exists at all, append the following lines to your xorg.conf file

Section "ServerFlags"
    Option "DontZap"      "true"


You can also add the following option to disable switching to full text mode (VT).

    Option "DontVTSwitch" "true"

BE WARNED! this will disable both killing your X session forcefully and switching to text mode. If some application got hung and your X session is not responding you will have to restart your machine.


Blog at
Entries and comments feeds.