Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2002 12:50:30 +1100
From:      Edwin Groothuis <edwin@mavetju.org>
To:        Bernie <Bernie_X@myrealbox.com>
Cc:        questions@freebsd.org
Subject:   Re: shutdown
Message-ID:  <20020127125030.S823@k7.mavetju.org>
In-Reply-To: <20020127012015.X4706-100000@BLAST>; from Bernie_X@myrealbox.com on Sun, Jan 27, 2002 at 01:22:00AM %2B0200
References:  <20020127122850.R823@k7.mavetju.org> <20020127012015.X4706-100000@BLAST>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 27, 2002 at 01:22:00AM +0200, Bernie wrote:
> 
> 
> On Sun, 27 Jan 2002, Edwin Groothuis wrote:
> 
> > On Sun, Jan 27, 2002 at 01:20:29AM +0000, Dimitri T wrote:
> > > is it possible to give a user (other than root) the
> > > right to shutdown the system?
> >
> > If you look at the permissions of /sbin/shutdown, you see:
> > -r-sr-x---  1 root  operator  166304 Sep 19 03:27 /sbin/shutdown
> >
> > So everybody in the group operator can issue the shutdown command.
> >
> > Edwin
> >
> > --
> > Edwin Groothuis   |              Personal website: http://www.MavEtJu.org
> > edwin@mavetju.org |           Interested in MUDs? Visit Fatal Dimensions:
> > ------------------+                       http://www.FatalDimensions.org/
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> >
> >
> 
> i was looking at the same for 'halt'
> 
> -r-xr-xr-x  4 root  wheel     228812 Dec 27 11:24 halt
> 
> seems everyone can use it...

Everybody can run it, only a few can run it succesfully:

[~] edwin@friet44>halt
halt: Operation not permitted
[~] edwin@friet44>groups
wheel operator

Reading the source:
        if (geteuid()) {
	    errno = EPERM;
	    err(1, NULL);
	}

The call to geteuid will always return non-zero for non-root users,
so non-root users will not be able to run halt (reboot, fasthalt,
fastboot)

Edwin

-- 
Edwin Groothuis   |              Personal website: http://www.MavEtJu.org
edwin@mavetju.org |           Interested in MUDs? Visit Fatal Dimensions:
------------------+                       http://www.FatalDimensions.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020127125030.S823>