From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3FD4F138CC5 for ; Mon, 23 Mar 2015 12:17:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 08438E0944; Mon, 23 Mar 2015 12:16:57 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CA7FDE092E for ; Mon, 23 Mar 2015 12:16:55 +0000 (UTC) Received: by oier21 with SMTP id r21so138736185oie.1 for ; Mon, 23 Mar 2015 05:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=NJUpRq/TXjliRpp/602uN5NNipO+w1QW+Mr6P36whss=; b=YasuYoIej3SVbdFHR37MaiUDHtgQhMvJ3HswXa6R9k0hM/vwzxPA8irAWqvhyCQFUz IO140S8EJ3qYAjkDyiE509XrMcTDSZG7bTV36OoCwqxzmX2z2lulP4fiNAE3nXdB2w8p tAc1I+ndrP9J0j/Bmc4Lk9wVDVU0vitlNpfVcBOoR1vUgkAtykiC08NO+zg32BsowTnh 2HKsVB3oKAL11ttJfctgWAResHZO/y75GG7XKO4EXKIQy3CLsOSgIEzOrRYk09SYxNhQ FePPBMgy1Is4YvPX99jC+dgLrhKLX6HJjN4HYvBWm0QW42ECoGnIaOwvsJwR0RajpsjA 5Z+Q== X-Received: by 10.60.133.176 with SMTP id pd16mr6609658oeb.78.1427113015264; Mon, 23 Mar 2015 05:16:55 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.76.79.3 with HTTP; Mon, 23 Mar 2015 05:16:25 -0700 (PDT) In-Reply-To: <23787818.Bd5keXIqRP@wstn> References: <20150321152656.a82a84b3e8a32c8b68554548@gmail.com> <2098241.ygyfAjpUPx@wstn> <23787818.Bd5keXIqRP@wstn> From: Emanuele Rusconi Date: Mon, 23 Mar 2015 13:16:25 +0100 Message-ID: Subject: Re: [gentoo-user] How to poweroff the system from user? To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=047d7b47287654497c0511f3a4c0 X-Archives-Salt: bfa298cf-9a11-41bb-974e-5138f8af05ce X-Archives-Hash: f409565adc41aa031b300616c5e61985 --047d7b47287654497c0511f3a4c0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 23 March 2015 at 10:46, Peter Humphrey wrote: > On Sunday 22 March 2015 14:36:36 Jc Garc=C3=ADa wrote: > > 2015-03-22 4:30 GMT-06:00 Peter Humphrey : > > > On Saturday 21 March 2015 16:20:17 Jc Garc=C3=ADa wrote: > > >> > Interesting. But as I said ealier, I can reboot the system when I = am > > >> > a > > >> > user by Ctrl+Alt+Delete. The user can reboot the system, but can't > > >> > shut > > >> > down? Strange > > >> > > >> It's not strange, `man 2 reboot`. It's a defined behavior. > > > > > > I'm with German here. Being designed that way doesn't stop it being > > > strange. > > I see it as a last resource available for rebooting under any > > circumstances( Similar to what you can do with Sysrq). > > > > > Consider: I'm an ordinary user sitting at a terminal. I'm not allowed > to > > > halt the machine, but I am allowed to reboot it into perhaps some qui= te > > > other configuration. Or I can keep rebooting it over and again, > > > effectively preventing the machine from doing its job. How does that > > > make sense? > > It doesn't and that's why it's configurable, if you are in a high > > security requiring environment, you disable it. > > The consensus seems to be that there's no point in trying to prevent a us= er > from rebooting the machine, and I'm happy to go along with that. > > The remaining question is: why is the user not allowed to halt it? > > -- > Rgds > Peter. > > > Maybe some people here missed my post. You CAN allow the user to halt: just substitute ca:12345:ctrlaltdel:/sbin/shutdown -r now with ca:12345:ctrlaltdel:/sbin/shutdown -P now in /etc/inittab and Ctrl-Alt-Del will shutdown instead of reboot. In fact, Ctrl-Alt-Del can be set up to do whatever you want and will have root privileges. If this is a security hole for your use case, you can comment it or set it to ca:12345:ctrlaltdel: /bin/echo 'Hey, don't touch me there!' , or you can disable it entirely in the kernel. -- Emanuele --047d7b47287654497c0511f3a4c0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 23 March 2015 at 10:46, Peter Humphrey <peter@prh.= myzen.co.uk> wrote:
On Sunday 22 March 2015 14:36:36 Jc Garc=C3=ADa w= rote:
> 2015-03-22 4:30 GMT-06:00 Peter Humphrey <peter@prh.myzen.co.uk>:
> > On Saturday 21 March 2015 16:20:17 Jc Garc=C3=ADa wrote:
> >> > Interesting. But as I said ealier, I can reboot the syst= em when I am
> >> > a
> >> > user by Ctrl+Alt+Delete. The user can reboot the system,= but can't
> >> > shut
> >> > down? Strange
> >>
> >> It's not strange,=C2=A0 `man 2 reboot`. It's a define= d behavior.
> >
> > I'm with German here. Being designed that way doesn't sto= p it being
> > strange.
> I see it as a last resource available for rebooting under any
> circumstances( Similar to what you can do with Sysrq).
>
> > Consider: I'm an ordinary user sitting at a terminal. I'm= not allowed to
> > halt the machine, but I am allowed to reboot it into perhaps some= quite
> > other configuration. Or I can keep rebooting it over and again, > > effectively preventing the machine from doing its job. How does t= hat
> > make sense?
> It doesn't and that's why it's configurable, if you are in= a high
> security requiring environment, you disable it.

The consensus seems to be that there's no point in trying t= o prevent a user
from rebooting the machine, and I'm happy to go along with that.

The remaining question is: why is the user not allowed to halt it?

--
Rgds
Peter.



Maybe= some people here missed my post.

You CAN allow the user to halt: ju= st substitute
ca:12345:ctrlaltdel:/sbin/shutdown -r now
with
ca:12= 345:ctrlaltdel:/sbin/shutdown -P now
in /etc/inittab and Ctrl-Alt-Del wi= ll shutdown instead of reboot.

In f= act, Ctrl-Alt-Del can be set up to do whatever you want and will
have ro= ot privileges.

If this is a securit= y hole for your use case, you can comment it or set
it to
ca:12345:ct= rlaltdel: /bin/echo 'Hey, don't touch me there!'
, or you can disable it entirely in the kernel.
--
Emanu= ele
--047d7b47287654497c0511f3a4c0--