Help - Search - Members - Calendar
Full Version: Remote shutdown without logging in
MandrivaUsers.org > Advanced Topics > Other Linux and Unix Distributions
somedude
Hi everybody,

I have a UNIX server connected to one of the two UPS units. The other UPS is running two windoze servers. There is a USB connection from both UPS's to the domain controller (sorry - windoze), which sees them as a battery. I set the events to shutdown the server when the battery level drops below a set level. The other windoze machine works very well with this setup.

So far so good. I would really like to shutdown the UNIX server when a power failure lasts too long. Since the windoze server monitors the event, I could use a script to shut down the UNIX server remotely, except I don't know of a way to do it without being specifically logged on. There is no USB on the UNIX machine and I don't think SCO would be able to see it either.

I tried the remote shell (rsh), for which windoze has a command, but I can't get it to work, because I can't specify the password. Telnet needs an interactive password, so I can't use it. I tried adding the windoze server to /etc/hosts to no avail.

Since it's on a secure LAN, I don't mind sending the password across, if need be.

I know this is not Linux, but I would really appreciate a clue.

Thank you very much.

[moved from Networking by spinynorman]
Qchem
Could you not do this via ssh, using an ssh passkey to log into the unix box from windows?
somedude
If I knew what that means... smile.gif Just kidding, I will do some reading, I've never used ssh. Your post leads me to believe that there are ssh tools in windoze.

Thanks for the advice.

Update: oops, looks like my SCO server doesn't have ssh. I can get open ssh for both, but I was hoping there's an easier way.
Gowator
also there is a UPS monitoring package (forget the name but search in add software) that might be more appropraite.
somedude
@Gowator,

That would have been too easy... My problem is that I can't connect the UPS to the server as it requires USB.
Gowator
/me slaps myself in face with wet fish

ouch...

erm Im learning to read... bear with me in the meantime...

so yep ssh is best....
you can use trusted hosts (/etc/hosts.allow) and an rexec or rlogin but its not really the best or any simpler than ssh.
somedude
QUOTE (Gowator @ Jun 11 2004, 10:02 AM)
/me slaps myself in face with wet fish

DON"T! smile.gif

Hey, I appreciate the simple fact that you took the time to reply. Thank you for that.
And thaks for the advice.

I know ssh is the most secure and elegant solution, but I dread having to install more stuff on both servers.
I tried rexec to no avail, even after adding the win machine in hosts.allow (which, by the way I had to create in /etc - not sure if it's because of sco 5).
rlogin also needs an explicit password, so... :(

Thanks again.
somedude
Well, I know I need closure, so I figured you may want to know what's goin' on, even tho' you may not like the solution. I don't, but I was out of ideas.

I wrote a VB program that uses 'SendKey' to tell telnet what to do, including login info and the shutdown command. It is triggered by a battery event on the windoze server and shuts down SCO.

I hate it, but it's extremely simple and it's consistent with M$'s crappy way to do things....
somedude
More Google-ing and the fact that I wanted to be a true Linux user, made me revise the process:

rsh -l root shutdown -g0 -y

did the trick, after adding the machine to /etc/hosts and creating /.rhosts with the machine name and user name in it.

*IX rocks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.