Weblog entry #1 for alish

Restricting system reboots through the console
Posted by alish on Sun 9 Dec 2007 at 06:05
Restricting system reboots through the console

If your system has a keyboard attached to it anyone (yes anyone) can reboot the system through it without login to the system. This might, or might not, adhere to your security policy. If you want to restrict this, you must check the /etc/inittab so that the line that includes ctrlaltdel calls shutdown with the -a switch (remember to run init q after making any changes to this file). The default in Debian includes this switch:

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

Now, in order to allow some users to shutdown the system, as the manpage shutdown(8) describes, you must create the file /etc/shutdown.allow and include there the name of users which can boot the system. When the three finger salute (a.k.a. ctrl+alt+del) is given the program will check if any of the users listed in the file are logged in. If none of them is, shutdown will not reboot the system.

 

Comments on this Entry

Posted by ajt (204.193.xx.xx) on Mon 10 Dec 2007 at 14:27
[ Send Message | View Weblogs ]
It's a topic that has been mentioned before.

http://www.debian-administration.org/users/ajt/weblog/101

However not with your suggestion. It sounds like a nice idea.

--
"It's Not Magic, It's Work"
Adam

[ Parent | Reply to this comment ]

Posted by alish (217.218.xx.xx) on Mon 10 Dec 2007 at 16:05
[ Send Message | View Weblogs ]
You are write,I copyed this from:
http://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.ht ml#s-restrict-reboots

I am new in debian administration and I decide to put all things that I learn in my blog.

[ Parent | Reply to this comment ]

Posted by mcortese (213.70.xx.xx) on Mon 10 Dec 2007 at 14:37
[ Send Message | View Weblogs ]

You should also make sure that your kernel does not have the Magic SysRq option turned on, otherwise an Alt+SysRq+B would have the same effect of the three-finger salute, but without syncing the disc, which is worse!

Besides, if you are really concerned about people rebooting your PC, don't forget to enclose your PC in a locked cabinet, otherwise nothing prevents the passer-by from simply unplugging the power supply.

There is an illuminating story about Kevin Mitnick winning a "crack-this-PC contest" during an IT exhibition because the coders had put so much effort in the crypto stuff that they had forgot to secure the hardware!

[ Parent | Reply to this comment ]

Posted by alish (217.218.xx.xx) on Mon 10 Dec 2007 at 16:09
[ Send Message | View Weblogs ]
Thanks for your help, how I can disable this?

[ Parent | Reply to this comment ]

Posted by mcortese (213.70.xx.xx) on Tue 11 Dec 2007 at 16:33
[ Send Message | View Weblogs ]

The Magic SysRq is controlled by the compile-time option CONFIG_MAGIC_SYSRQ in the kernel configuration. It can also be disabled at run-time with

# echo 0 > /proc/sys/kernel/sysrq

Also see Magic SysRq key on Wikipedia (but I suspect that the last paragraph "Raising Skinny Elephants" is wrong: it suggests a key sequence that cause a disk access after the supposedly last sync).

[ Parent | Reply to this comment ]

Posted by Anonymous (88.89.xx.xx) on Sat 15 Dec 2007 at 19:31
heres a quick sed for disabling it:
sed -i 's/ca::ctrlaltdel:/#ca::ctrlaltdel:/g' /etc /inittab

[ Parent | Reply to this comment ]

Posted by Anonymous (88.89.xx.xx) on Sat 15 Dec 2007 at 19:34
woops, that was for redhat based systems, debian system are a little different:
sed -i 's/^ca:12345:ctrlaltdel:/#ca:12345:ctrlaltdel:/g ' /etc/inittab

[ Parent | Reply to this comment ]

Posted by endecotp (86.6.xx.xx) on Sun 16 Dec 2007 at 23:44
[ Send Message | View Weblogs ]
If you would like to get a menu ("Shutdown, Reboot, Cancel?") when pressing ctrl-alt-del from either the console or X, have a look at this page that I wrote about how to do that:

http://chezphil.org/cadmenu/

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search