|
In Linux, because of the security concerns, we allow anyone to press Ctrl-Alt-Del to restart the system. But in a production environment, you should disable the feature by pressing Ctrl-Alt-Del to restart the system.
In this article, we will describe how to disable the hotkey under RHEL and CentOS.
### In RHEL 5.X and CentOS 5.X
The init process is protected from Ctrl-Alt-Del, something like the following edit '/ etc / inittab' in the 'ca :: ctrlaltdel:' the beginning of the line:
[Root @ localhost ~] # cat / etc / inittab
# Trap CTRL-ALT-DELETE
#ca :: ctrlaltdel: / sbin / shutdown -t3 -r now
We can also change 'ca :: ctrlaltdel:' line to the output log, if anyone wanted to use the hot key to restart the server, there will be a log,
[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"
In RHEL6.X and CentOS 6.X
In RHEL6.X and CentOS 6.X, the hotkey's behavior is controlled by the '/etc/init/control-alt-delete.conf'.
The first step before the change, first with the following command to back up configuration
[Root @ localhost ~] # cp -v /etc/init/control-alt-delete.conf /etc/init/control-alt-delete.override
The second step Edit the file, the 'exec / sbin / shutdown' line instead of using the configuration below, this configuration will output logs Each 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" |
|
|
|