Saturday, May 18, 2019

How to disable system reboot using “Alt+Ctrl+Del” combination in CentOS/RHEL 7

In CentOS/RHEL operating systems, pressing "Ctrl + Alt + Del" key combination by default initiates a system reboot without any user confirmation. In case if you want to disable this behavior you can run below command:

[root@localhost ~]# systemctl mask ctrl-alt-del.target

OR

[root@localhost ~]# ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target

Now you can try pressing "Ctrl + Alt + Del" key combination and you will see instead of rebooting system it will log below messages to log file "/var/log/messages":

May 18 13:16:07 localhost systemd: Received SIGINT.
May 18 13:16:07 localhost systemd: Failed to enqueue ctrl-alt-del.target job: Unit is masked.


To enable "Ctrl + Alt + Del" key combination for system reboot:

[root@localhost ~]# systemctl unmask ctrl-alt-del.target