0

Disable CTRL-ALT-DEL from rebooting a Linux machine

Scripting ImageIn normal hardening techniques one should in an enterprise setting always disable the usage of CTRL+ALT+DEL to reboot a Linux Machine.

This key sequence is handled in /etc/inittab by the following line (from a RHEL5.5 machine)

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

You can simply disable this by running the following:

perl -npe 's/ca::ctrlaltdel:\/sbin\/shutdown/#ca::ctrlaltdel:\/sbin\/shutdown/' -i /etc/inittab

Which is in essence just adding a # in front to comment it out, which removes the said functionality.

You can do more with the said trap, and assign it a different command, one I personally use is:
ca::ctrlaltdel:/bin/echo “CTRL-ALT-DEL has been disabled by the administrator”

Of course you can add a much harsher message to the person that’s running the said key strokes, but I try to keep mine professional.

After updated the /etc/inittab you’ll have to reload init by running the following as root:

/sbin/init q


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

About the Author

I am ben kevan.. Well yeah. .that's about it.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.