Disable Ctrl-Alt-Del
Disable Ctrl-Alt-Del
禁用ctrl-alt-delete,为了防止和其他键盘冲突或误关机,可取消快捷键ctrl+alt+del
RHEL 5.X & CentOS 5.X
注释掉 ca::ctrlaltdel
# cat /etc/inittab # Trap CTRL-ALT-DELETE #ca::ctrlaltdel:/sbin/shutdown -t3 -r now
修改为:
# cat /etc/inittab # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/bin/logger -p authpriv.warning -t init "Console-invoked Ctrl-Alt-Del was ignored"
RHEL6.X & CentOS 6.X
# cp -v /etc/init/control-alt-delete.conf{,.bak} 替换行exec /sbin/shutdown # cat /etc/init/control-alt-delete.conf exec /usr/bin/logger -p authpriv.notice -t init "Ctrl-Alt-Del was pressed and ignored"
RHEL 7 / CentOS 7 / RHEL 8 / CentOS 8
# ln -sf /dev/null /etc/systemd/system/ctrl-alt-del.target 或 # systemctl mask ctrl-alt-del.target
参考链接: https://www.linuxtechi.com/disable-reboot-using-ctrl-alt-del-keys/