Subscribe to 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

image

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"
EndSection

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.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 05/31/08 and tagged with: Linux

Disclaimer: Many of our articles require making changes to your system. While we fully test and stand by our advice, there is still the potential for problems when making any configuration changes. Please be careful.

Comments (4)

  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

    @Scott

    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.


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Sponsored Links
Getting Started
About How-To Geek
Popular Articles

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.