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