Description

This article describes how to disable a Linux system from rebooting when <Ctrl>+<Alt>+<Del> is pressed.

Prerequisites:

  1. These steps are for Servers with Linux Operating Systems only.

Content / Solution:

RedHat/CentOS 5

  1. As root, edit the /etc/inittab file:

    # vi /etc/inittab
  2. Comment out the line with “#” sign then save and quit:

    # ca::ctrlaltdel:/sbin/shutdown -t3 -r now
  3. Re-initialize “init” process by:

    # init q
  4. If you check the log, you will see

    # tail /var/log/messages
    Apr 30 10:16:41 10-12-34-56 init: Re-reading inittab 

RedHat/CentOS 6

  1. Make a copy of the “control-alt-delete.conf” then edit the new file:

    # cd /etc/init
    # cp control-alt-delete.conf control-alt-delete.override
    # vi control-alt-delete.override
  2. Comment out the ‘shutdown’ entry, you must add another “exec….” line  or it won’t work.  In the example below,  log a message to system syslog: 

    # exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
    exec /usr/bin/logger -p authpriv.notice -t init "Ctrl-Alt-Del was pressed and ignored"
  3. If <Ctrl>+<Alt>+Del> keys stroke was pressed, you will see syslog message like below:

     

    # tail /var/log/secure
    Apr 30 14:10:49 10-12-34-56 init: Ctrl-Alt-Del was pressed and ignored

RedHat/CentOS 7

  1. Link the system “/dev/null” to the system file so the system will not react to the key strokes:

     

    # ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target
    # ls -l /etc/systemd/system/ctrl-alt-del.target
    lrwxrwxrwx 1 root root 9 Apr 30 14:14 /etc/systemd/system/ctrl-alt-del.target -> /dev/null
  2. If <Ctrl>+<Alt>+Del> keys stroke was pressed, syslog messages file will show:

     

    # tail /var/log/messages
    Apr 30 14:17:54 10-12-34-56 systemd: Failed to enqueue ctrl-alt-del.target job: Unit ctrl-alt-del.target is masked.

Ubuntu 10/12

  1. Edit the “control-alt-delete.conf” file directly:

     

    # cd /etc/init
    # vi control-alt-delete.conf
  2.  Comment out the “shutdown” entry and add another “exec” to do nothing:

     

    # exec shutdown -r now "Control-Alt-Delete pressed"
    exec false

Ubuntu 14

  1. Make a copy of the “control-alt-delete.conf” then edit the new file:

     

    # cd /etc/init
    # cp control-alt-delete.conf control-alt-delete.override
    # vi control-alt-delete.override
  2. Comment out the “shutdown” entry and add another “exec” to do nothing:

     

    # exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
    exec false

SuSE 11

  1. Edit the “/etc/inittab” file:

     

    # vi /etc/inittab
  2. Comment out this line with a “#” sign:

     

    # ca::ctrlaltdel:/sbin/shutdown -t3 -r now
  3. Re-initialize “init” process by:

     

    # init q
  4.  If you check the log, you will see:

     

    # tail /var/log/messages
    Apr 30 10:16:41 10-12-34-56 init: Re-reading inittab