Re: user shutingdown/rebooting system w/wo sudo

2017-07-20 Thread Lck Ras
On 07/20/2017 05:39 PM, Fungi4All wrote:
> Apart from what different wm/dm do, should a user without sudo
> priviledges be able to stop or restart a system?
> In most wm I have seen the user is able to do this without being
> asked for root priviledges and I believe this is wrong and should
> not be done.

As far as I know, this is done by policykit (policykit-1 in the repos).
Among other things, it allows users that are logged in locally to
shutdown/reboot the system, unless there are other users logged in.
Pretty sure it's possible to override this if you don't want this to happen.

> As I see contradictory reading material on the issue from the
> point of view of a single user personal system to an enterprise
> system, why would any desktop come with this activated as
> default and not be the other way around but with a simple option
> for root to change/activate this ability.

If the user has physical access to the machine, there isn't really a
point to stopping them from shutting the system down, really. I can't
really think of instances where this could be a security issue, and it
can be overridden if you don't want it.

Also, for users coming from other OSes, it may be odd that they are
unable to shut down their system without being an administrator, and it
wouldn't allow shared laptops/computers.



Re: user shutingdown/rebooting system w/wo sudo

2017-07-20 Thread Reco
Hi.

On Thu, Jul 20, 2017 at 04:39:20AM -0400, Fungi4All wrote:
> Apart from what different wm/dm do, should a user without sudo
> priviledges be able to stop or restart a system?
> In most wm I have seen the user is able to do this without being
> asked for root priviledges and I believe this is wrong and should
> not be done.
> As I see contradictory reading material on the issue from the
> point of view of a single user personal system to an enterprise
> system, why would any desktop come with this activated as
> default and not be the other way around but with a simple option
> for root to change/activate this ability.
> I suspect that systemd with its countless strange service users
> has complicated this issue, but is this practice secure?

If a user can unplug a wall socket and power off PC this way - then
root requirement of poweroff is redundant.
Likewise if a user can press 'reset' button on PC - requiring to be root
is redundant for rebooting.
Same goes for laptops, tablets and even servers in certain situations.

On the other hand, if user connects to own PC by some means of remote
desktop protocol (be it VNC,  RDesktop, SPICE, NoNX or good old
X) - then it's not the best idea probably to provide a user a simple way
to reboot or poweroff.

So, it all depends on whenever user has a physical access to the host in
question. Whenever certain software running as PID1 is able to identify
whenever is user 'on console' or not is can of worms that I refuse to
open.

Reco