<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: Disabling shutdown/reboot for users?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>David-</FONT>
</P>

<P><FONT SIZE=2>I am forwarding to you, and list, a reply from a list user on Psyche where before I asked the same question.</FONT>
</P>

<P><FONT SIZE=2>-------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>Hi,</FONT>
</P>

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

<P><FONT SIZE=2>Hope this helps,</FONT>
</P>

<P><FONT SIZE=2>Cheryl</FONT>
</P>

<P><FONT SIZE=2>#!/bin/sh</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2># Disable non-root shutdowns</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2># /etc/X11/gdm/gdm.conf</FONT>
<BR><FONT SIZE=2>mv /etc/X11/gdm/gdm.conf /etc/X11/gdm/gdm.conf.orig</FONT>
<BR><FONT SIZE=2>sed 's!SystemMenu=true!SystemMenu=false!' /etc/X11/gdm/gdm.conf.orig > /etc/X11/gdm/gdm.conf</FONT>
<BR><FONT SIZE=2>chown root:root /etc/X11/gdm/gdm.conf</FONT>
<BR><FONT SIZE=2>chmod 644 /etc/X11/gdm/gdm.conf</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2># /etc/pam.d/reboot</FONT>
<BR><FONT SIZE=2>mv /etc/pam.d/reboot /etc/pam.d/reboot.orig</FONT>
<BR><FONT SIZE=2>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</FONT></P>

<P><FONT SIZE=2>chown root:root /etc/pam.d/reboot</FONT>
<BR><FONT SIZE=2>chmod 644 /etc/pam.d/reboot</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2># /etc/pam.d/halt</FONT>
<BR><FONT SIZE=2>mv /etc/pam.d/halt /etc/pam.d/halt.orig</FONT>
<BR><FONT SIZE=2>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</FONT></P>

<P><FONT SIZE=2>chown root:root /etc/pam.d/halt</FONT>
<BR><FONT SIZE=2>chmod 644 /etc/pam.d/halt</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2># /etc/pam.d/poweroff</FONT>
<BR><FONT SIZE=2>mv /etc/pam.d/poweroff /etc/pam.d/poweroff.orig</FONT>
<BR><FONT SIZE=2>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</FONT></P>

<P><FONT SIZE=2>chown root:root /etc/pam.d/poweroff</FONT>
<BR><FONT SIZE=2>chmod 644 /etc/pam.d/poweroff</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2>#</FONT>
<BR><FONT SIZE=2># /etc/inittab</FONT>
<BR><FONT SIZE=2>mv /etc/inittab /etc/inittab.orig</FONT>
<BR><FONT SIZE=2>sed 's!ca::ctrlaltdel:/sbin/shutdown -t3 -r now!#ca::ctrlaltdel:/sbin/shutdown -t3 -r now!' /etc/inittab.orig > /etc/inittab</FONT></P>

<P><FONT SIZE=2>chown root:root /etc/inittab</FONT>
<BR><FONT SIZE=2>chmod 644 /etc/inittab</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Cheryl Southard</FONT>
<BR><FONT SIZE=2>cld@astro.caltech.edu</FONT>
</P>

<P><FONT SIZE=2>-Channon </FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: David Jackson [<A HREF="mailto:trashcan@mustardandrelish.com">mailto:trashcan@mustardandrelish.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Sunday, January 11, 2004 8:36 AM</FONT>
<BR><FONT SIZE=2>To: fedora-list@redhat.com</FONT>
<BR><FONT SIZE=2>Subject: Disabling shutdown/reboot for users?</FONT>
</P>

<P><FONT SIZE=2>Howdy --</FONT>
<BR><FONT SIZE=2>How can I disable the shutdown/reboot on the startup menu for standard users?</FONT>
</P>

<P><FONT SIZE=2>And/Or force them to enter the root password (like redhat-config-*)?</FONT>
</P>

<P><FONT SIZE=2>TX,</FONT>
<BR><FONT SIZE=2>David</FONT>
</P>
<BR>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>fedora-list mailing list</FONT>
<BR><FONT SIZE=2>fedora-list@redhat.com</FONT>
<BR><FONT SIZE=2>To unsubscribe: <A HREF="http://www.redhat.com/mailman/listinfo/fedora-list" TARGET="_blank">http://www.redhat.com/mailman/listinfo/fedora-list</A></FONT>
</P>

</BODY>
</HTML>