Centos only allows root users to disable the system through ctrl + alt + delete
Source: Internet
Author: User
By default, the Linux system uses the/etc/inittab file to control whether reboot or shutdown is performed when the system simultaneously presses the -- combination key before the system terminal. If you want to, you can completely disable this function. Just add the annotator "#" in front of the ca: ctrlaltdel:/sbin/shutdown-t3-rnow in this file. In addition, we can also customize some non-root users in the co default situation, in Linux, the/etc/inittab file is used to control whether reboot or shutdown is performed when the system simultaneously presses the -- combination key before the system terminal. If you want to, you can completely disable this function. In this file:
Ca: ctrlaltdel:/sbin/shutdown-t3-r now
Add the annotator "#" to the beginning. In addition, we can also customize some non-root users to have the right to press ctrl-alt-delete in front of the console to shut down the system. The procedure is as follows:
1. add the-a tag in the above configuration. For example:
Ca: ctrlaltdel:/sbin/shutdown-a-t3-r now
-A flag notifies the shutdown program to view the/etc/shutdown. allow file, which will be created below
2. create the shutdown. allow file in the/etc/directory, which lists the usernames that can be disabled by pressing the ctrl-alt-delete combination button. The Shtdown. allow file format is one user per line:
Chenlf
Peter
Oracle8i
For the above example, the system will allow the user chenlf, peter, and oracle8i to close the system by pressing -- in front of the console. When a user uses the combination key --, shutdown checks/etc/shutdown. whether the user (or root) In allow is currently logged on through the virtual terminal. if any of them is logged on, shutdown will continue; otherwise, an error message will be returned:
No authorized users logged in
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.