Linux – How to disable ctrl-alt-del and /etc/init/control-alt-del.conf in Linux

consoleinitlinuxrhelsysvinit

My OS is RHEL 6.2

I disable Ctrl+Alt+Del by changing in /etc/init/control-alt-del.conf the line

exec /sbin/shutdown -r now "Control-alt-del pressed"

by

exec /bin/true

I'll be testing it next Sunday.

My questions:

  1. are there any daemons to restart?

  2. I keep a copy on original /etc/init/control-alt-del.conf in /etc/init, is it safe?
    I mean won't the shutdown part of exec be fired?

  3. more official way to disable Ctrl+Alt+Del?


edit:

tested on vmware player 6.0.3 (for what it is worth, this is not a virtualization issue)

  1. editing file, no exec line, no restart, user logged on gui, send Ctrl+Alt+Del : shutdown prompt
  2. after restart, no exec line, user logged on gui, send Ctrl+Alt+Del : shutdown prompt
  3. after restart, exec /bin/true, user logged on gui, send
    Ctrl+Alt+Del : shutdown prompt
  4. after restart, exec /bin/true, no user logged on gui, send
    Ctrl+Alt+Del : no shutdown prompt

Best Answer

Since this is the way to enable a function that acts on pressing Ctrl+Alt+Del, it is also the, probably official, point to switch if off.

You should just comment out ('#' in front of the line) the exec shutdown... and there is no need to insert exec /bin/true. No need to keep a copy of the file if you just comment things out.

I would reboot the system after the change, as I think it is init itself that reads that file, not some daemon. Just changing the file without further action doesn't have any effect¹.

¹ In the good old days you would set the Ctrl+Alt+Del handling in /etc/inittab and you could issue a init q after a change.

Related Question