Linux CENTOS7/RHEL7 off Ctrl+alt+delete function keys

Source: Internet
Author: User

Linux defaults to allow anyone to restart the system by pressing Ctrl+alt+del . However, in a production environment, the ability to restart the system by pressing Ctrl-alt-del should be deactivated. The previous CentOS version is configured in/etc/inittab, while centos7/RHEL7 views The/etc/inittab file, "Ctrl-alt-delete ishandled by/usr /lib/systemd/system/ctrl-alt-del.target "points out this function key in the"/usr/lib/systemd/system/ctrl-alt-del.target "setting.   

[email protected] ~]# Cat/etc/inittab
# Inittab is no longer used when using SYSTEMD.
#
# ADDING CONFIGURATION here'll has NO EFFECT on YOUR SYSTEM.
#
# Ctrl-alt-delete is handled By/usr/lib/systemd/system/ctrl-alt-del.target
#
# SYSTEMD uses ' targets ' instead of runlevels. By default, there is both main targets:
#
# multi-user.target:analogous to RunLevel 3
# graphical.target:analogous to RunLevel 5
#
# to view current default target, run:
# Systemctl Get-default
#
# to set a default target, run:
# systemctl Set-default target.target
#

Straight connect vim To edit this file, according to the previous settings to turn off the function of the way to operate: All comments out the contents of the/usr/lib/systemd/system/ctrl-alt-del.target file. However, since this file is a soft-link file for/usr/lib/systemd/system/reboot.target, this will invalidate the reboot command, so you only need to delete the file if you want to solve the problem:/usr/lib/ Systemd/system/ctrl-alt-del.target can be executed at the same time #init Q Reload the configuration file so that the configuration takes effect, Ctrl+alt+del fails at this time, and reboot can also be used, Recovery Ctrl+alt+del only need to reboot.target file soft link into ctrl-alt-del.target. That

  # ln-s/usr/lib/systemd/system/reboot.target/usr/lib/systemd/system/ctrl-alt-del.target

Linux centos7/rhel7 off ctrl+alt+delete function keys

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.