Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Tom Veitch on November 18, 2002, 04:06:08 AM

Title: remote shutdown
Post by: Tom Veitch on November 18, 2002, 04:06:08 AM
Can any one help
i want to send a shutdown command to a SME server from a windows 2000 server that has ups software running.

eg Win 2000 ups software has found that the power is out and i have it run a batch file before shutting down the batch file will tell the SME box to shut down.


Regards

Tom
Title: Re: remote shutdown
Post by: Michael Smith on November 18, 2002, 05:01:04 AM
You're in luck ... I asked a very similar question not long ago and was rewarded with some very interesting ways to do just what you're asking.

http://forums.contribs.org/index.php?topic=15439.msg59327#msg59327
Title: Re: remote shutdown
Post by: Michael Smith on November 18, 2002, 05:15:56 AM
One potential stopper:  I finally got around to actually using this (wish I'd tried it sooner) and it turns out that if you create another user, that user has to have superuser power.  At least at my level of knowledge.  I'd welcome additional input!
Title: Re: remote shutdown
Post by: Nathan Fowler on November 18, 2002, 07:37:05 AM
Just "adduser -r", I think that grants system rights.  If not you could usermod to change group memberships...


Hope this helped,
Nathan
Title: Re: remote shutdown
Post by: Nathan Fowler on November 18, 2002, 07:39:04 AM
usermod -G root I think accomplishes what you want...

Hope this helped,
Nathan
Title: Re: remote shutdown
Post by: Tom Veitch on November 18, 2002, 09:40:26 AM
thankyou all for your help

the answer was in the

c:\plink -l root -pw password 192.168.1.1 /sbin/shutdown -h now

Regards

Tom
Title: Re: remote shutdown
Post by: Michael Smith on November 18, 2002, 08:24:29 PM
It works all right, but as was pointed out to me in the initial thread, this exposes your root password in plaintext if you put it in a batch file.  This is a serious security breach!
Title: Re: remote shutdown
Post by: Tom Veitch on November 18, 2002, 08:36:33 PM
Yes i agree,

so to setup a shutdown user is a good idea

Once again Thanks

Regards

Tom