In CentOS/RHEL 7, /etc/init/control-alt-delete.override no more works to override the key combination. The post provides the procedure to disable “alt+ctrl+del” key combination in order to prevent an accidental shutdown.


Masking the Target


1. If requirement is to disable the “ctrl+Alt+delete” key combination, one need to mask a service. This is like disabling a service. Run the following command:

# systemctl mask


# ln -sf /dev/null /etc/systemd/system/


2. systemd will recognize units symlinked to /dev/null and show them as masked. If one try to send key combination, this will fail with following similar error.

June 9 02:33:43 geeklab systemd: Failed to enqueue job: Unit is masked.


3. However, above steps will not disable “ctrl+Alt+delete” key combination, in GUI mode. To disable it in GUI change keyboard settings.

Navigate to  Applications -> System Tools -> Settings -> Keyboard  -> Shortcuts -> System 
Set value of "Logout" as Disabled


Unmasking the Target


To unmask the Target and revert back, run the following command:

# systemctl unmask



Disabling “ Target” in GUI mode, using CLI


Use the steps below to disable the “Alt+Ctrl+Del” key combination in GUI, using CLI.


Disabling per user


1. We need to check the value of “DBUS_SESSION_BUS_ADDRESS” environment variable from the already logged in GNOME. For example, a `testuser` has already logged in to the GNOME, and form the GNOME terminal, we use the following command:



2. Mark down the output and then turn to the ssh session and export it:

$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-3UIRkKkjAU,guid=15771e3a5dcb3a7b2c151d00566a2dda


3. Now we can use gsettings to set the value of the key:

$ gsettings set logout ''


4. Check if the key is successfully modified:

$ gsettings get logout


Disabling for all users


1. Create a file under the directory ‘/etc/dconf/db/local.d/‘ with the settings to be applied globally. For example:

# cat /etc/dconf/db/local.d/00-disable-CAD 


2. Update the dconf settings:

# dconf update


Verify if the ‘ctrl-alt-del’ key combination is disabled globally.


Răspunsul a fost util? 0 utilizatori au considerat informația utilă (0 Voturi)