禁用ctrl_alt_del重启(How do we disable control-alt-delete on Ubuntu 16.04)
In previous versions of Ubuntu server, to disable
Del (reboot), we would edit the /etc/init/control-alt-delete.conf file and change the script to display a message telling that this function won't work anymore.
In 16.04, where is that file now?
What would be the new way to disable CtrlAltDel, now?
In the systemd world,
Del is handled by ctrl-alt-del.target:
ctrl-alt-del.target systemd starts this target whenever Control+Alt+Del is pressed on the console. Usually, this should be aliased (symlinked) to reboot.target.
To disable this target, do:
systemctl mask ctrl-alt-del.target systemctl daemon-reload
This does not completely disable
Del. Systemd has a feature where pressing that key combination more than 7 times in 2 seconds triggers an immediate reboot. I'm not sure how to disable it, but I find it useful.
I don't think it can be disabled. From the systemd manpage:
SIGINT Upon receiving this signal the systemd system manager will start the ctrl-alt-del.target unit. This is mostly equivalent to systemctl start ctl-alt-del.target. If this signal is received more than 7 times per 2s, an immediate reboot is triggered. Note that pressing Ctrl-Alt-Del on the console will trigger this signal. Hence, if a reboot is hanging, pressing Ctrl-Alt-Del more than 7 times in 2s is a relatively safe way to trigger an immediate reboot. systemd user managers treat this signal the same way as SIGTERM.
offline url:Console Security