In CentOS/Rhel 6 shutdown.allow no longer works like in previous versions. Only root is allowed to use Ctrl-Alt-Del.

1. Remove all lines and add the following lines in /etc/init/control-alt-delete.conf

start on control-alt-delete
exec /sbin/control-alt-delete.sh

2. Create /sbin/control-alt-delete.sh and add the following lines

vi /sbin/control-alt-delete.sh

#!/bin/bash

user=`w | grep tty | grep root | cut -d’ ‘ -f1`
if [ -z $user ] then
echo “control + alt + delete tried by non-root user at `date` ” >> /var/log/cad.log
else
/sbin/shutdown -r now “Control-Alt-Delete pressed”
fi

3. Give permission to the file

chmod 500 /sbin/control-alt-delete.sh

Leave a Reply

Your email address will not be published. Required fields are marked *