how to give gumstix user permission to reboot?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to give gumstix user permission to reboot?

Alex4
I'm trying to give one user permission to change the IP address of the gumstix and restart

Is reboot the only way to set the new ip address in /etc/network/interfaces?  If so, how to give user permission to execute 'reboot' making that user the root?

all the file permissions for reboot and halt seem to indicate user should be able to execute, but system('reboot') doesn't allow user to reboot, returning message:

reboot: must be superuser.


Reply | Threaded
Open this post in threaded view
|

Re: how to give gumstix user permission to reboot?

Dave Hylands
Hi Alex,

On Tue, Nov 24, 2009 at 9:21 AM, Alex4 <[hidden email]> wrote:

>
> I'm trying to give one user permission to change the IP address of the
> gumstix and restart
>
> Is reboot the only way to set the new ip address in /etc/network/interfaces?
> If so, how to give user permission to execute 'reboot' making that user the
> root?
>
> all the file permissions for reboot and halt seem to indicate user should be
> able to execute, but system('reboot') doesn't allow user to reboot,
> returning message:
>
> reboot: must be superuser.

Normally, you would use the sudo command (or su command) to allow
non-root users to do root style things. I haven't used this on the
gumstix, but that's how it works on normal linux. su require knowing
the root password, sudo doesn't.

Also, you should be able to do something like

/etc/init.d/network restart

to shutdown and startup the network stuff without doing a reboot.
Running the /etc/init.d/network script still requires being root.

--
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|

Re: how to give gumstix user permission to reboot?

Alex4
the conventional linux/unix approaches allowing a user to reboot don't seem to be working for me, and so part of this may be my learning how to do it on the gumstix linux distribution.  I even tried adding the user to the root group in /etc/group and that doesn't seem to work either.

btw, this is why it seems I need to reboot for the new ip address
$etc/init.d/networking restart  
Reconfiguring network interfaces... Auto negotiation NOT supported

I tried creating a group called rebooter then adding my user to that in /etc/group and it didn't work either

lrwxrwxrwx    1 root     rebooter       15 Jan  1  1970 reboot -> reboot.sysvinit
lrwxrwxrwx    1 root     rebooter        4 Jan  1  1970 reboot.sysvinit -> halt
lrwxrwxrwx    1 root     rebooter       13 Jan  1  1970 halt -> halt.sysvinit
-rwxr-xr-x    1 root     rebooter     9148 Jan  1  1970 halt.sysvinit

$/sbin/reboot
reboot: must be superuser.

$cat /etc/group | grep rebooter
rebooter:x:64004:user


Dave Hylands wrote
Normally, you would use the sudo command (or su command) to allow
non-root users to do root style things. I haven't used this on the
gumstix, but that's how it works on normal linux. su require knowing
the root password, sudo doesn't.

Also, you should be able to do something like

/etc/init.d/network restart

to shutdown and startup the network stuff without doing a reboot.
Running the /etc/init.d/network script still requires being root.
Reply | Threaded
Open this post in threaded view
|

Re: how to give gumstix user permission to reboot?

Dave Hylands
Hi Alex,

On Tue, Nov 24, 2009 at 12:58 PM, Alex4 <[hidden email]> wrote:

>
> the conventional linux/unix approaches allowing a user to reboot don't seem
> to be working for me, and so part of this may be my learning how to do it on
> the gumstix linux distribution.  I even tried adding the user to the root
> group in /etc/group and that doesn't seem to work either.
>
> btw, this is why it seems I need to reboot for the new ip address
> $etc/init.d/networking restart
> Reconfiguring network interfaces... Auto negotiation NOT supported
>
> I tried creating a group called rebooter then adding my user to that in
> /etc/group and it didn't work either
>
> lrwxrwxrwx    1 root     rebooter       15 Jan  1  1970 reboot ->
> reboot.sysvinit

Adding your user to the group just allows access to the reboot file,
it won't make reboot run as root.

You could also get the user sticky bit:

chmod u+s reboot, and then reboot will run as root. Of course, using
sticky bits has security implications...

--
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|

Re: how to give gumstix user permission to reboot?

Alex4
Hi Dave,

the chmod u+s /sbin/reboot works

brilliant!

Dave Hylands wrote
Adding your user to the group just allows access to the reboot file,
it won't make reboot run as root.

You could also get the user sticky bit:

chmod u+s reboot, and then reboot will run as root. Of course, using
sticky bits has security implications...