View previous topic :: View next topic |
Author |
Message |
bobber205 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/134572374589f0d90e4bd.jpg)
Joined: 23 Aug 2006 Posts: 561 Location: Oregon
|
Posted: Tue Aug 21, 2007 11:37 pm Post subject: Shutdown Tool |
|
|
You guys have heard of Wake on Lan right?
Well, is there anything like it for shutting down a machine on lan?
I know what you're thinking... ssh in and so a shutdown command.
I need to be able to shut down windows boxes from the terminal based on hostname. ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Voltago Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/5021960813fd4cfeb02cbe.jpg)
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Tue Aug 21, 2007 11:56 pm Post subject: |
|
|
Install ssh server on the windows machine (e. g. from openssh.org or tectia.com or with cygwin), find a way to shut down windows from a DOS prompt, and you're set.
EDIT: Forget tectia.com, they offer only trial versions for free.
EDIT2: Forget also openssh.org, they don't offer packages for windows, there is a project that does that on sourceforge, but they're badly outdated. So cygwin it is, I guess... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ToeiRei Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/6751558806237adbec266c.jpg)
Joined: 03 Jan 2005 Posts: 1191 Location: Austria
|
Posted: Wed Aug 22, 2007 8:58 am Post subject: |
|
|
I am using APC tools here to do so. - UPS stuff simulating a power failure. The clients are shutting down as they assume, battery's low at the UPS.
Rei _________________ Please stand by - The mailer daemon is busy burning your messages in hell... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ok Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/1790175990470fddd57d325.gif)
Joined: 11 Jul 2006 Posts: 390 Location: germany
|
Posted: Wed Aug 22, 2007 4:23 pm Post subject: |
|
|
If your LAN is save, you can use telnet. Activate the service on the windows computer (it is installed by default), then you can use:
# shutdown -s -t xx
xx is the time in seconds.
If some one know how this can be done automatic, i am interested in it... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Corona688 Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/164511503041338d913f8fb.gif)
Joined: 10 Jan 2004 Posts: 1204
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Wed Aug 22, 2007 6:03 pm Post subject: |
|
|
try this: http://users.pandora.be/jbosman/poweroff/poweroff.htm
Quote: | You can remotely control poweroff by starting it as a service and setting the Allow remote control option. You can control it by using poweroff itself and selecting a remote computer, or you can control it by using telnet to the port where poweroff listens on (default 3210). |
_________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ok Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/1790175990470fddd57d325.gif)
Joined: 11 Jul 2006 Posts: 390 Location: germany
|
Posted: Wed Aug 22, 2007 7:22 pm Post subject: |
|
|
Corona688 wrote: | Something like Code: | echo "command" | telnet computer | maybe? |
This does not work:
echo "pw" | telnet -a host
...
Connection closed by foreign host. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Mben Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 29 Mar 2004 Posts: 465 Location: New York, USA
|
Posted: Wed Aug 22, 2007 10:36 pm Post subject: |
|
|
I think it can be done with rpcclient (part of samba)
something like
Code: |
rpcclient -U user computer
[password]
shutdown
|
But I'm not sure and don't have a windows machine handy. Check the rpcclient man page around line 222 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|