How-To Geek

Disable Ctrl+Alt+Backspace from Restarting X Windows on Linux

If you’ve used Linux for any amount of time, you’re already familiar with the Ctrl+Alt+Backspace shortcut key combination that restarts X Windows immediately… but have you ever wondered if there is a way to disable that behavior?

Turns out it’s extremely simple to do, although I’m not necessarily recommending that you do this… it’s more for informational purposes. (while Linux might be rock-solid, I’ve had more than my share of crashing in Gnome, so the shortcut key is useful)

Disable Ctrl+Alt+Backspace

The first thing you’d probably want to do is make a backup of the xorg.conf file, which you can do with this command:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig

Then you can edit the xorg.conf file by using Alt+F2 to open up the Run dialog and using the following command:

gksu gedit /etc/X11/xorg.conf


Now go to the bottom of the file and look for a section called “ServerFlags”, which might not exist. If the section does not exist, add this to the bottom of the file:

Section "ServerFlags"
Option "DontZap"  "yes"

If that section does exist, then just add in the option line:

Option "DontZap"  "yes"

You’ll have to restart X again, the easiest way is ironically by using Ctrl+Alt+Backspace… but at that point the shortcut key won’t be active anymore.

If you somehow managed to totally screw up your system by making this change, you can copy the xorg.conf.orig file back to xorg.conf to switch back to the original configuration.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 05/31/08

Comments (8)

  1. Scott Wegner

    Although the Ctrl+Alt+Backspace shortcut may be a slight annoyance for new Linux users, what alternative do you have when your X windows freezes? Is there some way to perhaps re-map this to another key combination? Disabling it completely will force users to hard-reboot when the GUI freezes, which is a much worse alternative.

  2. The Geek


    Note that I recommended against using this… I like the key combination and end up needing to use it all the time. I’m not sure about re-mapping, that was going to be my next research…

    This could be useful if you wanted to setup an internet kiosk, for example, and didn’t want anybody to be able to kill X.

  3. Anonymous Coward

    The the author realize that there is no such thing as “X-Windows?” It’s called “the X-Window System.” Windows is something from Redmond.

  4. Brett Rasmussen

    I don’t know how to remap, but you can simply ctrl+alt+f1 (or f2-f6) to go to a text-mode terminal, log in as root, and restart your display manager. If you’re using gnome, it’s “/etc/init.d/gdm restart”, and there’s kdm for KDE or xdm for others. Keep in mind that it will jump you to your newly started display manager’s login screen on the f7 virtual terminal, but you’ll still be logged in as root on f1 (and, though they probably wouldn’t guess it’s there, anybody could come and use a root shell on your box). So when you first see that login screen, hit ctrl+alt+f1 again, log out, then hit ctrl+alt+f7 to get back to X.

    Thanks for the info, by the way. I use a kinesis keyboard, and backspace is at my left thumb. I hit it by accident all the time, and from time to time kill my whole X session inadvertently.

  5. John

    I try to disable it… but it doesn`t work, please help!!!

  6. thahir1986

    it’s not work…..after restart instead of diable the key shortcut is reduce into low level graphics….i was really scared…

  7. thahir1986

    I think ‘dontzap is only possible in jaunty jackalope (Ubuntu 9.04)..i tried in ubuntu 8.04, it was not worked and also i cant install dontzap using apt-get …

    Any how , thanks to geek

  8. shubham

    It works on Fedora and RH both. Thanks.

More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!