Standard installations of most, if not all, Linux distributions are set up so that pressing Control-Alt-Delete will perform a immediate shutdown of the computer. This is normally fine for a single-user system, since it saves having to login as root just to shut the system down. However, it doesn't work as well in the following scenarios:
The best course of action in the cases above is to change the default behaviour of Control-Alt-Delete. This is configured in /etc/inittab, under the entry for ca.
one-one-nine:~$ grep ^ca /etc/inittabIn this example (an out-of-the-box RedHat 5.2), hitting control-alt-delete will result in the command
/sbin/shutdown -t3 -r now
being run.
So, you can do essentially anything you want from here. For a system which people use remotely, it would probably be best to require users to log in as root to reboot/shutdown. Educate them that shutdown -r +5 (to give a 5 minute warning before actually doing the deed) is better than using now. My preference is to edit the line in inittab to read:
ca::ctrlaltdel:/bin/echo Please login as root and run \"shutdown\" to shut this system down.which is relatively terse, but does tell users what to do.
Please note: /etc/inittab is only normally read when the system starts up. If you want this change to be recognised immediately, you must tell the system to reread the file. You can do this by running the following command as root:
kill -HUP 1