禁用ctrl_alt_del重启(How do we disable control-alt-delete on Ubuntu 16.04)

In previous versions of Ubuntu server, to disable Ctrl+Alt+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?

shutdown 16.04 reboot systemd

answer:

In the systemd world, Ctrl+Alt+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 Ctrl+Alt+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

  • qq_43638135
    妲己再美究为妃: 博主没有想过自己接一些私活干吗?我现在还没毕业,但是我也确实听说外挂市场自动化游戏脚本市场挺火热的,并且报酬也很丰厚,但是具体的我也不是很清楚,求解答。 (1个月前 #47楼) 查看回复(2) 举报 回复
    22