Jump to content

Remote Shutdown of Mandriva from Windows [solved]


cm2k
 Share

Recommended Posts

Hi,

 

I have the Linux box working great now :D - thanks for everyones help :) I just have one last hurdle to conquer, I have the box connected to a UPS however there is no serial cable so it cannot tell when it has gone to battery. :wall:

 

I have a script that sends a shutdown command to a Windows 2003 box on the same UPS and that works great I need a similar way to do this with Linux.

 

I have looked at SSH, but couldn't get the script to work without needing me to enter the password.

I am now trying RSH, but keep getting Access Denied, or when I run RSH -L Linux Shutdown the DOS Screen just sits there with RSH.exe running doing nothing.

 

I have enabled RSH in RSH script, and added my IP to the Host.allow.

 

Am I missing anything?

 

Or does anybody have a better way to fireoff the shutdown script from a Windows box?

 

Thanks again :)

 

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

Name: apcupsd

Version: 3.10.18-3mdk

Architecture: i586

Size: 9274 KB

 

Summary: Power management software for APC UPS hardware

 

sounds like an old UPS and you have 2 PC's on it ?

Edited by ddmcse
Link to comment
Share on other sites

Name: apcupsd

Version: 3.10.18-3mdk

Architecture: i586

Size: 9274 KB

 

Summary: Power management software for APC UPS hardware

 

sounds like an old UPS and you have 2 PC's on it ?

 

Hi,

 

No it's quite a new one, we just don't have the cables to connect them through serial, and I cannot get any spend to go get some :( So I have to make the best of what I have got.

Link to comment
Share on other sites

I have looked at SSH, but couldn't get the script to work without needing me to enter the password.

 

You can solve that problem by generating an ssh key. Here's a nice tutorial on ssh that goes into the process in some detail:

 

http://www.suso.org/docs/shell/ssh.sdf

 

That's doing it from a local linux box to a remote linux box. There should be a similar procedure for doing this in a mixed windows/linux environment but I'm not that familiar with ssh configuration in windows. If you're using putty, here's some info on key authentication in windows:

 

http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey

 

The idea is to use the generated keys as the method of authentication instead of user passwords. Once it's set up, you can automaically login without giving the password.

Link to comment
Share on other sites

Thanks for that, I have configure SSH and it is using Public/Private Keys now howver the only problem is that it now asks me for the passphrase each time.

 

If I made a Public Key/Private Key with no passphrase would this get around it?

 

How can I get around this, I need it to login and fire off the the shutdown command

Link to comment
Share on other sites

Never mind - I got it working now :) I used blank passphrases and called Putty from the command line with the switches, shuts Linux down great - Am going to add it to my larger script and test it now :)

 

Thanks for the help guys, much appreciated

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...