Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deactivate the function of pressing Ctrl-Alt-Del to restart the system under RHEL/CentOS 5ram 6

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you the function of how to disable and press Ctrl-Alt-Del to restart the system under RHEL/CentOS 5. 6. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

In Linux, for security reasons, we allow anyone to press Ctrl-Alt-Del to restart the system. However, in a production environment, the ability to restart the system by pressing Ctrl-Alt-Del should be disabled.

Under RHEL 5.X and CentOS 5.X #

To 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 line 'ca::ctrlaltdel:'' to output logs. If anyone wants to restart the server with this hotkey, 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

Under RHEL6.X and CentOS 6.x, the behavior of the hotkey is controlled by'/ etc/init/control-alt-delete.conf'.

* * before making changes, back up the configuration with the following command

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

The second step is to edit the file and replace the line 'exec / sbin/shutdown'' with the following configuration, which outputs the log each 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" above is the function shared by Xiaobian about how to disable and restart the system by pressing Ctrl-Alt-Del under RHEL/CentOS 5. If you happen to have similar doubts, please refer to the above analysis for understanding. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report