CentOS disables pressing Ctrl-Alt-Del to restart the system
In Linux, for security considerations, we allow anyone to press Ctrl-Alt-Del to restart the system. However, in the production environment, press Ctrl-Alt-Del to restart the system.
[root@localhost~]
#cat/etc/inittab
#TrapCTRL-ALT-DELETE
#ca::ctrlaltdel:/sbin/shutdown-t3-rnow
We can also change the 'Ca: ctrlaltdel: 'line to output logs. If anyone wants to use this hotkey to restart the server, there will be logs,
[root@localhost~]#cat/etc/inittab
#TrapCTRL-ALT-DELETE
ca::ctrlaltdel:/bin/logger-pauthpriv.warning-tinit
"Console-invokedCtrl-Alt-Delwasignored"
Under RHEL6.X and CentOS 6. X
In RHEL6.X and CentOS 6. X, the actions of the hotkey are as follows'/Etc/init/control-alt-delete.conf 'control.
Step 1: Back up the configuration with the following command before the change
[root@localhost~]#cp-v/etc/init/control-alt-
delete
.conf/etc/init/control-alt-
delete
.override
Step 2 edit the file and replace the 'exec/sbin/shutdown 'line with the following configuration. This configuration will output the log every time you press Ctrl-Alt-Del:
[root@localhost~]#cat/etc/init/control-alt-
delete
.confexec/usr/bin/logger-pauthpriv.notice-tinit