system shutdown without using root login

system shutdown without using root login

Post by ICEMANJ » Fri, 03 Dec 1999 04:00:00



Hello,

I am trying to write a script that would bring down a SUN Solaris server
without logging into it as root.  The main goal is to have computer operations
login as as servopp, and have this account execute a script that switches to SU
and performs a init 0.  I need help with doing this.  If anyone has any ideas
if this could be done, I would appreciate it.
Thanks
Joe

 
 
 

system shutdown without using root login

Post by Neoh Kee Li » Fri, 03 Dec 1999 04:00:00


You can install sudo to let specified user to run root-only-commands such as
shutdown, reboot, init etc. Available at sunfreeware.com.

Neoh Kee Lin


> Hello,

> I am trying to write a script that would bring down a SUN Solaris server
> without logging into it as root.  The main goal is to have computer
operations
> login as as servopp, and have this account execute a script that switches
to SU
> and performs a init 0.  I need help with doing this.  If anyone has any
ideas
> if this could be done, I would appreciate it.
> Thanks
> Joe



 
 
 

system shutdown without using root login

Post by Roland Main » Fri, 03 Dec 1999 04:00:00


Hi !

----


> I am trying to write a script that would bring down a SUN Solaris server
> without logging into it as root.  The main goal is to have computer operations
> login as as servopp, and have this account execute a script that switches to SU
> and performs a init 0.  I need help with doing this.  If anyone has any ideas
> if this could be done, I would appreciate it.

Take a look at the sys-suspend(1M) manual page.
Add the user "servopp" to /etc/default/sys-suspend and run
/usr/openwin/bin/sys-suspend with the matching options, thats all (BTW: A wrapper
script which checks if users are still logged in would be very usefull...).

----

Bye,
Roland

--
  __ .  . __


  /O /==\ O\  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
 (;O/ \/ \O;) TEL +49 (0) 641/99-13193 FAX +49 (0) 641/99-41359

 
 
 

system shutdown without using root login

Post by John T. Douglas » Fri, 03 Dec 1999 04:00:00


Although I personally disable the sys-suspend command, if you have
that available then it already allows ordinary users to shutdown the
machine.  man sys-suspend.

In this instance you could group permissions to allow execution.

-- John


> You can install sudo to let specified user to run root-only-commands such as
> shutdown, reboot, init etc. Available at sunfreeware.com.

> Neoh Kee Lin



> > Hello,

> > I am trying to write a script that would bring down a SUN Solaris server
> > without logging into it as root.  The main goal is to have computer
> operations
> > login as as servopp, and have this account execute a script that switches
> to SU
> > and performs a init 0.  I need help with doing this.  If anyone has any
> ideas
> > if this could be done, I would appreciate it.
> > Thanks
> > Joe


--
John T. Douglass                        Phone: 208 533 7992

           "A train stops at a trainstation, a bus stops
            at a bustation, what happens at a workstation?"
 
 
 

system shutdown without using root login

Post by Bill Calkin » Fri, 03 Dec 1999 04:00:00


Another method:
Create a new user called "shutdown".  Give UID of 0.  Specify /usr/sbin/shutdown
instead of /sbin/sh for the shell (in /etc/passwd). When logging in as shutdown,
the shutdown command executes.

-Bill


> Although I personally disable the sys-suspend command, if you have
> that available then it already allows ordinary users to shutdown the
> machine.  man sys-suspend.

> In this instance you could group permissions to allow execution.

> -- John


> > You can install sudo to let specified user to run root-only-commands such as
> > shutdown, reboot, init etc. Available at sunfreeware.com.

> > Neoh Kee Lin



> > > Hello,

> > > I am trying to write a script that would bring down a SUN Solaris server
> > > without logging into it as root.  The main goal is to have computer
> > operations
> > > login as as servopp, and have this account execute a script that switches
> > to SU
> > > and performs a init 0.  I need help with doing this.  If anyone has any
> > ideas
> > > if this could be done, I would appreciate it.
> > > Thanks
> > > Joe

> --
> John T. Douglass                        Phone: 208 533 7992

>            "A train stops at a trainstation, a bus stops
>             at a bustation, what happens at a workstation?"

 
 
 

system shutdown without using root login

Post by Ben Taylo » Sat, 04 Dec 1999 04:00:00



: You can install sudo to let specified user to run root-only-commands such as
: shutdown, reboot, init etc. Available at sunfreeware.com.

One of my coworkers tried this and it doesn't work.  The problem is that
sudo is killed during a shutdown and you therefore lose your rights as
"root" and the shutdown doesn't complete.

Ben


:>
:> Hello,
:>
:> I am trying to write a script that would bring down a SUN Solaris server
:> without logging into it as root.  The main goal is to have computer
: operations
:> login as as servopp, and have this account execute a script that switches
: to SU
:> and performs a init 0.  I need help with doing this.  If anyone has any
: ideas
:> if this could be done, I would appreciate it.
:> Thanks
:> Joe

:>

 
 
 

system shutdown without using root login

Post by Lyle Merd » Mon, 06 Dec 1999 04:00:00



: : You can install sudo to let specified user to run root-only-commands such as
: : shutdown, reboot, init etc. Available at sunfreeware.com.
:
: One of my coworkers tried this and it doesn't work.  The problem is that
: sudo is killed during a shutdown and you therefore lose your rights as
: "root" and the shutdown doesn't complete.
:
: Ben
:

I use sudo all the time to do "init" commands or reboot/shutdown.
When I issue a sudo reboot and type in my password I get my command prompt
back for a few seconds while the system starts shutting down...

Lyle