Re: How do I make a User login shutdown my box?

From: Jurvis LaSalle (lasalle_at_bard.edu)
Date: 09/27/04

  • Next message: menonrr_at_jmu.edu: "Rate control with IPtables in Redhat 9"
    Date: Mon, 27 Sep 2004 17:56:34 -0400
    To: General Red Hat Linux discussion list <redhat-list@redhat.com>
    
    

    On Sep 27, 2004, at 6:02 AM, Stuart Halliday wrote:

    > I've got RedHat 8 on a Athlon box and I'd like a user logon to perform
    > a shutdown of the box.
    >
    > I was advised to do the following:
    > I've added a user called 'Sleep' and added this user to the root group
    > via the User Manager program and made its login shell /sbin/shutdown
    > in the /etc/passwd.
    >
    > I've added in the users directory 2 lines in the .bashrc of:
    > PATH=$PATH:/sbin
    > export PATH
    > as I understand it this path isn't usually in a users path.
    >
    > I added the user sleep to the /etc/shutdown.allow file as well.
    >
    > But when I logon via the logon screen as user 'sleep', the picture
    > goes black and then comes back again!
    >
    > I tried pressing ctrl-alt-del at the logon screen but a wee box pops
    > up asking for the root password to halt or reboot.
    >
    > Any idea what else I need to do?
    >
    > If any kind and knowledgeable person could guide me, I would welcome
    > that. :-)
    >
    > --
    > Stuart Halliday
    >
    >

    Contrary to all the other advice you've received, the cleanest way to
    have done this would be to read the man pages on pam_console (8) ,
    pam_console_apply (8), and console.apps (5). Proper settings will
    allow users logged in on the console (and only on the console) to
    simply shut down the machine with no need for sudo or any other
    rigamarole. This will also save you from mischief makers who could ssh
    into a machine while someone else is using it and then shut it down on
    them.

    HTH,
    Jurvis LaSalle

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: menonrr_at_jmu.edu: "Rate control with IPtables in Redhat 9"

    Relevant Pages

    • Re: Windows service shutdown
      ... Rather than worrying about that specific duration, ... you feel it necessary for it to sleep "for about 10-20 minutes" is hard to ... variable that indicates that the service is in its "sleeping" state. ... etc. as appropriate but you would still respond appropriately to shutdown ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Summary: Re: Spin down HDD after disk sync or before power off
      ... Alexander Motin wrote: ... It puts device into deeper sleep state. ... That code was expected to handle spindown on shutdown in unified fashion ... olivers patch into CAM. ...
      (freebsd-hackers)
    • Re: How do I make a User login shutdown my box?
      ... Write a simple shell script to call sudo shutdown ... How do I make a User login shutdown my box? ... I've added a user called 'Sleep' and added this user to the root group via ...
      (RedHat)
    • Re: Sleep v. Shutdown
      ... Gregory Weston wrote: ... I've read that putting the mac to sleep between ... I'd be very surprised if Sleep doesn't force disk flushes just like ... I'd be surprised, too, but if you're paranoid only shutdown is reliable. ...
      (comp.sys.mac.apps)
    • Re: swsusp + APM in 2.6.6
      ... With this setup, I could sleep, shutdown, and use swap ... even though I have it disabled at boot. ... you actually exploited bug in ACPI /proc handling. ...
      (Linux-Kernel)