Disable Ctrl-Alt-Del to restart the system in CentOS

Source: Internet
Author: User
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. In RHEL5.X and CentOS5.X

In Linux, we allow anyone to pressCtrl-Alt-DelComeRestartSystem. 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 ###

ProtectionInitProcess exemptionCtrl-Alt-Del, As shown below'/Etc/inittab'In Roy'Ca: ctrlaltdel: 'The first line:

[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-DELETEca::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 as follows'/Etc/init/control-alt-delete.conf'Control.

Step 1Before changing, use the following command to back up the configuration

[root@localhost ~]# cp -v /etc/init/control-alt-delete.conf /etc/init/control-alt-delete.override

Step 2Edit 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 -p authpriv.notice -t init "Ctrl-Alt-Del was pressed and ignored"

Via: http://www.linuxtechi.com/disable-reboot-using-ctrl-alt-del-keys/

Author: Pradeep Kumar translator: 2q1w2007 proofreader: wxy

This article was originally translated by LCTT and launched with the Linux honor in China


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.