How do i disable Ctrl + Alt + Del on CentOS 7 / RHEL 7

Disable Ctrl + Alt + Del on CentOS 7

Control-Alt-Delete is a combination key which initiates the soft reboot of servers, and this must be disabled to avoid the unexpected and unwanted reboot.

In CentOS 6, Ctrl-Alt-Delete was handled by inittab, and now it is managed by systemd in CentOS 7. This guide will help you to disable Ctrl-Alt-Delete on CentOS 7.

Let’s look at /etc/inittab file

cat /etc/inittab

Content will look like below.

# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /etc/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To set a default target, run:
#
# ln -sf /lib/systemd/system/.target /etc/systemd/system/default.target
#

From the above, inittab is no longer handles init function which includes Ctrl-Alt-Delete. Now we have to tell the systemd to disable it.

Use the following command to disable the Ctrl-Alt-Delete.

systemctl mask ctrl-alt-del.target

That’s All.

centos 7rhel 7
Comments (4)
Add Comment
  • Xaver

    Has no effect!

    • anonymous

      Try this
      ln -sf /dev/null /usr/lib/systemd/system/ctrl-alt-del.target

  • SMK1

    Dittto what Xaver said – no effect.

    • anonymous

      Try this

      ln -sf /dev/null /usr/lib/systemd/system/ctrl-alt-del.target