How can I enable Ctrl+Alt+Backspace?

This was tested on 13.10+, type the following on the terminal:

sudo dpkg-reconfigure keyboard-configuration

enter image description here

You will see the keyboard configuration. Press ENTER 5 times to skip all keyboard related options except for the Kill X part. When you get to the Kill X option which looks like this:

enter image description here

Select YES and press enter. Wait a bit while everything configures and after that you should have the ability to CTRL+ALT+BCKSPC right on the current session. After saving any work you have pending, try it yourself.

Perfect to solve any visual issues or annoying apps.

Thank you @david-c it also looks like this works:

Sudo Edit the /etc/default/keyboard file and add the line XKBPTIONS="terminate:ctrl_alt_bksp" to it, so it looks something like this:

enter image description here


For Unity (13.04 to 17.04):

You want: System->Preferences->Keyboard

Then click the Layouts tab, the Options button, and expand Key sequence to kill the X server, before finally selecting the checkbox.

Screenshot

To enable it via the command line install dontzap Install dontzap

sudo apt-get install dontzap

And in a terminal

sudo dontzap --enable

To disable the shortcut:

sudo dontzap --disable

For 13.10 and newer:

If you are looking for a solution which is independent of Gnome/KDE/Fluxbox or any Desktop Environment or Window Manager, try the following X Window System command. I need this because my Unity desktop is not loading (but X works fine), therefore there is no logout button.

From https://wiki.ubuntu.com/X/Config/DontZap#Using_the_command_line

Using the command line

You can type the following command to enable Zapping immediately.

setxkbmap -option terminate:ctrl_alt_bksp

If you're happy with the new behaviour you can add that command to your ~/.xinitrc in order to make the change permanent.

Also, according to the Ubuntu 10.04 LTS (Lucid Lynx), this has replaced the old DontZap feature from older versions of the X Window System.

In addition, the Ctrl+Alt+Backspace option is now configured as an X keymap (XKB) option, replacing the X server "DontZap" option and allowing per-user configuration of this setting.

This is explained further in the Xorg X11R7.5 Release Notes which, among other details, say:

Users who wish to have this functionality available by default may
enable it via the XKB configuration option “terminate:ctrl_alt_bksp”.