Disclaimer: We may earn a commission when you purchase products linked throughout our site.

DigitalOcean โ€” Cloud hosting for developers
Enable Ctrl+Alt+Backspace on Ubuntu 24.04 to Kill the X Server

Enable Ctrl+Alt+Backspace on Ubuntu 24.04 to Kill the X Server

How to re-enable the Ctrl+Alt+Backspace keyboard shortcut to terminate the X server on Ubuntu 24.04, with methods for GNOME, Xfce, and the command line.

Back in the day, Ctrl+Alt+Backspace was the universal escape hatch for a frozen Linux desktop โ€” it killed the X server instantly, dumping you back to the display manager login screen. Canonical disabled it in Ubuntu 9.04 after too many users hit it accidentally, and it has stayed off by default ever since. But if you are a developer, a system administrator, or anyone who regularly tests GPU drivers and desktop environments, having this shortcut available is a genuine time-saver. This guide shows how to re-enable it on Ubuntu 24.04 across GNOME, Xfce, KDE, and via the command line, with a clear explanation of what actually happens when you press it and when you might prefer an alternative approach.

What Ctrl+Alt+Backspace Actually Does

When enabled, this key combination sends a terminate signal to the X server process (Xorg). The X server shuts down, which kills all graphical applications running in your session. The display manager (GDM, LightDM, or SDDM) detects that X has exited and respawns the login screen.

Important: This only works on Xorg sessions. If you are running GNOME on Wayland (the Ubuntu 24.04 default), there is no X server to kill. The key combination will do nothing. You will need to switch to an Xorg session first, or use alternative recovery methods described in our restart X guide.

Method 1: GNOME Settings (GUI)

This is the simplest method if you are running GNOME on Xorg:

  1. Open Settings โ†’ Keyboard
  2. Scroll down to Keyboard Shortcuts
  3. This is where it gets unintuitive โ€” there is no toggle for Ctrl+Alt+Backspace in the standard settings UI

You actually need GNOME Tweaks:

sudo apt install gnome-tweaks

Open GNOME Tweaks โ†’ Keyboard (or Keyboard & Mouse depending on version) โ†’ Additional Layout Options โ†’ Key sequence to kill the X server โ†’ check the box.

Method 2: Command Line with setxkbmap

For a quick, session-only enable:

setxkbmap -option terminate:ctrl_alt_bksp

This takes effect immediately but does not survive a logout or reboot. To make it persistent, add the command to your ~/.xprofile:

echo 'setxkbmap -option terminate:ctrl_alt_bksp' >> ~/.xprofile

The .xprofile file is sourced by the display manager when your Xorg session starts.

Method 3: localectl (System-Wide, Persistent)

For a system-wide change that persists across reboots and applies to all users:

sudo localectl set-x11-keymap gb "" "" terminate:ctrl_alt_bksp

Replace gb with your keyboard layout (e.g., us, de, fr). The fourth argument is the XKB option.

Verify with:

localectl status

You should see terminate:ctrl_alt_bksp in the X11 options.

Method 4: Xfce Settings

In Xfce, the option is more accessible:

  1. Open Settings Manager โ†’ Session and Startup โ†’ actually, this is not the right place. Go to:
  2. Settings Manager โ†’ Keyboard โ†’ Layout tab
  3. Click Advanced (or Edit in some versions)
  4. Look for Key sequence to kill the X server
  5. Enable it

Alternatively, use the setxkbmap command from Method 2 โ€” it works identically under Xfce.

Method 5: KDE Plasma Settings

In KDE Plasma:

  1. System Settings โ†’ Input Devices โ†’ Keyboard
  2. Advanced tab
  3. Expand Key sequence to kill the X server
  4. Check the box
  5. Apply

Note: On the Plasma Wayland session, this option has no effect (same as GNOME Wayland).

Method 6: Xorg Configuration File

For environments where the GUI methods are unavailable (server with minimal desktop, custom session), create an Xorg configuration snippet:

sudo mkdir -p /etc/X11/xorg.conf.d
sudo tee /etc/X11/xorg.conf.d/99-terminate.conf << 'EOF'
Section "InputClass"
    Identifier "Terminate"
    MatchIsKeyboard "on"
    Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
EOF

Restart the X session for it to take effect.

When Not to Enable This

  • Shared or public machines: Someone hitting Ctrl+Alt+Backspace by accident kills everyone’s graphical session.
  • Wayland-only setups: The shortcut does nothing, so enabling it is pointless.
  • If you frequently hit Ctrl+Alt plus nearby keys: The Backspace key is close to other keys, and accidental triggers lose all unsaved graphical work.

Better Alternatives for Wayland Users

Since Ctrl+Alt+Backspace is an Xorg-only feature, Wayland users should set up alternative recovery shortcuts:

  • Switch to TTY: Ctrl+Alt+F3 always works, even when the desktop compositor is frozen. From the TTY, run sudo systemctl restart gdm3.
  • GNOME’s built-in restart: Alt+F2, type r, press Enter. This restarts GNOME Shell without killing applications (Xorg session only โ€” does not work on Wayland).
  • systemd user session kill: loginctl terminate-user $USER from a TTY kills your graphical session cleanly.

Verifying It Works

After enabling Ctrl+Alt+Backspace, test it (save your work first):

  1. Make sure you are on an Xorg session: echo $XDG_SESSION_TYPE should return x11
  2. Press Ctrl+Alt+Backspace
  3. The screen should go black briefly, then the login screen appears
  4. Log in โ€” you will have a fresh session

If nothing happens, verify the option was applied:

setxkbmap -query

Look for terminate:ctrl_alt_bksp in the options line.