Re: [PLUG] Allow user to shutdown host

2019-03-04 Thread Rich Shepard
On Sun, 3 Mar 2019, King Beowulf wrote: Instead of messing with sudo, you can configure the KDE and Xfce power manager (and other DEs) to trigger a shutdown command by pressing the power button. The user needs to be in the 'power' group IIRC. Ed, How interesting! I was unaware of this. For

Re: [PLUG] Allow user to shutdown host

2019-03-03 Thread King Beowulf
On 2/27/19 1:54 PM, Rich Shepard wrote: > Looking at /etc/sudoers I see the example: > %users  localhost=/sbin/shutdown -h now > > Will this permit the Sony Vaio user to halt the laptop? I thought I had her > set up to do this but it did not work today. If the above line allows > everyone in the

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Smith, Cathy
...@pdxlinux.org On Behalf Of Rich Shepard Sent: Wednesday, February 27, 2019 3:27 PM To: Portland Linux/Unix Group Subject: Re: [PLUG] Allow user to shutdown host On Wed, 27 Feb 2019, Smith, Cathy wrote: > You can just set up an alias in .bashrc or whatever file is used for aliases. > That's

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Rich Shepard
On Wed, 27 Feb 2019, Smith, Cathy wrote: You can just set up an alias in .bashrc or whatever file is used for aliases. That's what I do for folks here. I have a group set up for people needing to use a command. I edit the sudoers file once to set things up. It looks like

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Smith, Cathy
To: Portland Linux/Unix Group Subject: Re: [PLUG] Allow user to shutdown host On Wed, 27 Feb 2019, Paul Heinlein wrote: > My experience is that sudo expects the command line invocation to look > like the sudo configuration. So what I'd do is add a function, not an > alias, t

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Rich Shepard
On Wed, 27 Feb 2019, Paul Heinlein wrote: My experience is that sudo expects the command line invocation to look like the sudo configuration. So what I'd do is add a function, not an alias, to .bashrc: function halt { /sbin/shutdown -h now } But since "halt" is the name of an actual

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Paul Heinlein
On Wed, 27 Feb 2019, Rich Shepard wrote: On Wed, 27 Feb 2019, Rich Shepard wrote: Can I set an alias so when she exits X11 to a console all she needs to type is sudo halt and this will invoke /sbin/shutdown -h now? Gotta' keep in simple here. Saw a web blog post that suggests I if add

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Rich Shepard
On Wed, 27 Feb 2019, Rich Shepard wrote: Saw a web blog post that suggests I if add to her ~/.bash_rc the following alias alias halt='alias=`sudo ` halt' all she'd need to type is halt. Does this look workable? Nah. But this: alias "sd=sudo " would allow her to type sd halt according to

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Rich Shepard
On Wed, 27 Feb 2019, Rich Shepard wrote: Can I set an alias so when she exits X11 to a console all she needs to type is sudo halt and this will invoke /sbin/shutdown -h now? Gotta' keep in simple here. Saw a web blog post that suggests I if add to her ~/.bash_rc the following alias alias

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Rich Shepard
On Wed, 27 Feb 2019, Paul Heinlein wrote: The sudoers(5) man page states, Also, the host name “localhost” will only match if that is the actual host name, which is usually only the case for non-networked systems. Paul, Ah, I forgot to look at that man page. You'll want to replace

Re: [PLUG] Allow user to shutdown host

2019-02-27 Thread Paul Heinlein
On Wed, 27 Feb 2019, Rich Shepard wrote: Looking at /etc/sudoers I see the example: %users localhost=/sbin/shutdown -h now Will this permit the Sony Vaio user to halt the laptop? I thought I had her set up to do this but it did not work today. If the above line allows everyone in the users