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

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

 



On 14:53 Sep 27, 2004 "Stuart Halliday" <StuartH@xxxxxxxxxxxx> wrote:
>
> >  How about using sudo.  Write a simple shell script to call sudo
> >  shutdown then grant the sleep user access to this command with the
> >  NOPASSWD option in the sudoers file.
>
> Thanks Stuart that did it. Much appreciated.
> I'd never heard of sudo before.
>
> To help others who may also enquire in the future, here is what I did.
>
> I altered the /etc/passwd file so that the bash shell would be run
> when this user 'sleep' logs in.
> I gave the user 'sleep' in /etc/sudoers permission to run the
> poweroff command with no password.
> and I added the line in .bashrc:
>
> sudo /sbin/poweroff -i

A better solution would be to add the appropriate managers to a group that
is allowed to run poweroff. Then you would be able to see exactly who was
powering off the machine and you would not have to worry about people
managing an additional password.


--Tony



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

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux