Disable the system restart function by pressing Ctrl-Alt-Del in RHEL/CentOS 5/6
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.
In this article, we will introduce how to disable the hotkey in RHEL and CentOS.
### Under RHEL 5.x and CentOS 5.x ###
Protect the init process from Ctrl-Alt-Del. Edit the line starting with 'Ca: ctrlaltdel: 'In'/etc/inittab 'as follows:
- [Root @ localhost ~] # Cat/etc/inittab
- # Trap CTRL-ALT-DELETE
- # Ca: ctrlaltdel:/sbin/shutdown-t3-r now
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
- # Trap CTRL-ALT-DELETE
- Ca: ctrlaltdel:/bin/logger-p authpriv. warning-t init "Console-invoked Ctrl-Alt-Del was ignored"
Under RHEL6.X and CentOS 6. X
In RHEL6.X and CentOS 6. X, the actions of the hotkey are controlled by '/etc/init/control-alt-delete.conf.
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.conf
- Exec/usr/bin/logger-p authpriv. notice-t init "Ctrl-Alt-Del was pressed and ignored"
Diagram of the RedHat6.4 installation process by VMware
Red Hat Enterprise Linux 7 is now available for users to download
RHEL 6.3 installation tutorial
Red Hat Linux 7.0 installation illustration
Install Ubuntu 14.04 on a VMware Workstation 10 Virtual Machine in Windows 7
"Kernel requires an x86_64 cpu, but only detected" appears when CentOS x86_64 is installed in VMWare"
Install Linux on VMware Server