SUSE Support

Here When You Need Us

Disable reboot when ctrl-alt-del is pressed

This document (7023999) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Desktop 15
SUSE Linux Enterprise Server 12 
SUSE Linux Enterprise Desktop 12

Situation

When using a TTY console (a terminal device), by default, pressing ctrl alt del ( ctrl-alt-del )  will reboot the system. In some situations, this behavior may need to be disabled.
 

systemd

 
Systemd ctrl-alt-delete.target is by default aliased/symlinked to reboot.target; man systemd.special(7):

 

 

ctrl-alt-del.target
    systemd starts this target whenever Control+Alt+Del is pressed on the
    console. Usually, this should be aliased (symlinked) to reboot.target.
 

GNOME


In GNOME, we see that ctrl-alt-delete points to a logout plugin:

 

 

gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys org.gnome.settings-daemon.plugins.media-keys logout '<Control><Alt>Delete'

Resolution

systemd

 

To prevent systemd reacting on on ctrl-alt-del key combination on a TTY, mask ctrl-alt-del.target unit (this in fact creates symlink to /dev/null):

 

systemctl mask ctrl-alt-del.target

 

Now check to ensure the symlink has been set/updated as expected:
 

ls -l /etc/systemd/system/ctrl-alt-del.target
lrwxrwxrwx 1 root root 9 Mar 23 14:51 /etc/systemd/system/ctrl-alt-del.target -> /dev/null

 

Ctrl-alt-del reboot has now been disabled. Test ctrl-alt-del to verify.

NOTE: systemd has a feature to still perform an action if ctrl-alt-delete key combination is pressed on a condition that user presses the keys more than 7 times in 2 seconds. See man systemd-system.conf(5):
 

CtrlAltDelBurstAction=
    Defines what action will be performed if user presses Ctrl-Alt-Delete
    more than 7 times in 2s. Can be set to "reboot-force", "poweroff-force",
    "reboot-immediate", "poweroff-immediate" or disabled with "none". Defaults
    to "reboot-force".

 

To prevent systemd from reacting on ctrl-alt-delete burst, do:

1. set 'CtrlAltDelBurstAction=none' in /etc/systemd/system.conf
2. reload systemd configuration with: systemctl daemon-reload


 

GNOME
 

To change this behavior to no longer reboot in GNOME on ctrl-alt-del, change the value for the logout key to something else. In the following example, it will be changed to ctrl-alt-shift-del requiring shift to be pressed as well.

Run the following logged into gnome for the user you wish to change:
 

gsettings set org.gnome.settings-daemon.plugins.media-keys logout '<Control><Alt><Shift>Delete'


Now test ctrl-alt-del.

This will need to be run for each existing or new user which you wish to change the ctrl-alt-del behavior for.
This is not ideal, as a disadvantage of this is that this can be overwritten by the user too..)

When it is desirable to disable the ctrl-alt-del behavior globally and for all users, follow the following procedure :

Create /etc/dconf/profile/user  file with the following content :
 

user-db:user
system-db:local


Create /etc/dconf/db/local.d/01-local  file with the following content :
 

[org/gnome/settings-daemon/plugins/media-keys]
logout='<Control><Alt><Shift>Delete'


Lock the logout property by creating /etc/dconf/db/local.d/locks/media-keys  file with the following content :
 

/org/gnome/settings-daemon/plugins/media-keys/logout

Next save and update the dconf database :
 

dconf update

Cause

Once SLES or SLED has booted to a TTY (not graphical.target), ctrl-alt-delete is controlled by systemd from a terminal device. By default, we see that the ctrl-alt-delete.target is a symlink to reboot.target
 
GNOME (or SLE-Classic) uses hotkeys to reboot with the logout GNOME plugin. By default, it is ctrl-alt-del.

Additional Information

There may also be a desire to create Global Custom keybindings for shutdown.
This procedure has been detailed in TID 000019048 - Define global customer keybindings for shutdown

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7023999
  • Creation Date: 11-Jul-2019
  • Modified Date:30-Mar-2023
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.