homepage Welcome to WebmasterWorld Guest from 54.237.78.165
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Shut down or reboot without SUDO
ning

10+ Year Member



 
Msg#: 3488124 posted 8:20 am on Oct 26, 2007 (gmt 0)

My dedicated server needs a few more GB of RAM, and i want the co-location company to shut down the server nice in order to do the maintenance.

Is there a way to give the server guys a command to shut down the server nice without giving them root access?

 

wheel

WebmasterWorld Senior Member wheel us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3488124 posted 12:45 pm on Oct 26, 2007 (gmt 0)

I would hope not.

You're best bet is to have them call you when they're ready to do. You log in, shut it down, they can install the memory and bring it back up. You should be monitoring during this process anyway to make sure the server comes back online.

jtara

WebmasterWorld Senior Member jtara us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3488124 posted 6:29 pm on Oct 27, 2007 (gmt 0)

Give the vendor a non-privileged user account, and see if setting the SUID bit on "shutdown" will do the trick.

It would be prudent to remove the "rx" permissions for "others", and do a "chgrp" on "shutdown" from "root" to some new group. (For example, you might call the new group.... "shutdown".) Put the vendor's account in that group.

SeanW

10+ Year Member



 
Msg#: 3488124 posted 3:22 am on Oct 30, 2007 (gmt 0)

If you're running RedHat, /etc/pam.d/halt controls who can halt the box without root access. By default the user at the console can halt the box.

It works without setuid'ing the shutdown binary, I've never looked into how, but it does work.

edit: I took a quick search and it's done through /usr/sbin/userhelper

Sean

[edited by: SeanW at 3:25 am (utc) on Oct. 30, 2007]

wheel

WebmasterWorld Senior Member wheel us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3488124 posted 12:03 am on Oct 31, 2007 (gmt 0)

By default the user at the console can halt the box.

I think I'd forgotten that. Seems odd that this is the case, though I guess if you've got physical access you're not far from the power cord anyway.

I can tell you that 'shutdown -h now' in an ssh terminal session on your server looks almost exactly like the same command on a terminal session on your linux desktop. It looks enough alike that one might shut down some webservers at the datacenter thinking they were shutting down their local pc :).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved