[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Disable Shutdown and Reboot from the login screen



Hi,

Here's the section of our script that disables non-root shutdowns.
There are three parts.
	- gdm.conf - turns off reboots from the gnome login window
	- /etc/pam.d/{reboot,half, poweroff} - turns off reboots from
		inside gnome
	- /etc/inittab - turns off ctrl-alt-delete

Hope this helps,

Cheryl

#!/bin/sh
#
#
# Disable non-root shutdowns
#
# /etc/X11/gdm/gdm.conf
mv /etc/X11/gdm/gdm.conf /etc/X11/gdm/gdm.conf.orig
sed 's!SystemMenu=true!SystemMenu=false!' /etc/X11/gdm/gdm.conf.orig > /etc/X11/gdm/gdm.conf
chown root:root /etc/X11/gdm/gdm.conf
chmod 644 /etc/X11/gdm/gdm.conf
#
# /etc/pam.d/reboot
mv /etc/pam.d/reboot /etc/pam.d/reboot.orig
sed 's!auth[ 	]*required[ 	]*/lib/security/pam_console.so!#auth	required	/lib/security/pam_console.so!' /etc/pam.d/reboot.orig > /etc/pam.d/reboot
chown root:root /etc/pam.d/reboot
chmod 644 /etc/pam.d/reboot
#
# /etc/pam.d/halt
mv /etc/pam.d/halt /etc/pam.d/halt.orig
sed 's!auth[ 	]*required[ 	]*/lib/security/pam_console.so!#auth	required	/lib/security/pam_console.so!' /etc/pam.d/halt.orig > /etc/pam.d/halt
chown root:root /etc/pam.d/halt
chmod 644 /etc/pam.d/halt
#
# /etc/pam.d/poweroff
mv /etc/pam.d/poweroff /etc/pam.d/poweroff.orig
sed 's!auth[ 	]*required[ 	]*/lib/security/pam_console.so!#auth	required	/lib/security/pam_console.so!' /etc/pam.d/poweroff.orig > /etc/pam.d/poweroff
chown root:root /etc/pam.d/poweroff
chmod 644 /etc/pam.d/poweroff
#
#
# /etc/inittab
mv /etc/inittab /etc/inittab.orig
sed 's!ca::ctrlaltdel:/sbin/shutdown -t3 -r now!#ca::ctrlaltdel:/sbin/shutdown -t3 -r now!' /etc/inittab.orig > /etc/inittab
chown root:root /etc/inittab
chmod 644 /etc/inittab

-- 
Cheryl Southard
cld astro caltech edu





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]