LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Remote shutdown deamon/utility (https://www.linuxquestions.org/questions/slackware-14/remote-shutdown-deamon-utility-842990/)

user100 11-08-2010 04:29 AM

Remote shutdown deamon/utility
 
Hi,

Is there something like a remote shutdown daemon or utility for slackware available?

Something without having to log in and halt the system.
Like something you can combine with a windows system, or linux.



Thanks.

em21701 11-08-2010 09:37 AM

I'm not quite sure what you are asking for but you could try this from any linux machine and it will shut down the machine at the ip address you enter.
Code:

ssh root@<ip-address> halt

Gavin Harper 11-08-2010 10:05 AM

I will add to this and say from Windows you can install openssh client (works from cmd.exe like linux ssh) and / or PuTTY to remote "anything" on the linux box.

user100 11-09-2010 05:48 AM

Yes but its not for me.

I mean something like a daemon running on the slackware server and a simple "click app" for windows which will send the command or whatever to shut it down.

Slax-Dude 11-09-2010 01:19 PM

Quote:

Originally Posted by user100 (Post 4153459)
Yes but its not for me.

I mean something like a daemon running on the slackware server and a simple "click app" for windows which will send the command or whatever to shut it down.

You can use putty together with a simple script, and you'll have your clicky thingy that shuts down a linux box, provided such linux box is running sshd.

Make a text file (let's name it "poweroff_linux_box.txt") in the same directory as putty.exe and put the following in it:
Code:

poweroff
Now, make a text file named clicky_thingy.bat and put the following in it:

Code:

putty.exe -pw somepass -m poweroff_linux_box.txt someuser@someipaddress
Note1: replace the following with your own data
someipaddress = the ip address for your linux box
someuser = the username you use to login to your linux box
somepass = the password for the username you use to login to your linux box

Note2: this is EXTREMELY insecure, as the user + pass for your linux box are there in clear text for anyone to see and exploit. Use it at your own risk.

That's it... click away...

frieza 11-09-2010 01:25 PM

Quote:

Originally Posted by user100 (Post 4153459)
Yes but its not for me.

I mean something like a daemon running on the slackware server and a simple "click app" for windows which will send the command or whatever to shut it down.

yes but the whole point of making you log in/authenticate before shutting down the machine instead of having a simple 'button' to 'shut down' the machine is so that just anyone cant walk up and push that button and remotely shut down your machine when you least expect it. it's a trade off between security and simplicity and unlike with M$ and window$ that often will dummy down something to the point where it does away with quite a bite of security, with Linux security often takes a higher precedence over simplicity, be thankful there isnt a simple loophole in your server to simply click a button to remotely shut down your server without having to authenticate yourself

T3slider 11-09-2010 09:35 PM

Quote:

Originally Posted by Slax-Dude (Post 4153921)
Note2: this is EXTREMELY insecure, as the user + pass for your linux box are there in clear text for anyone to see and exploit. Use it at your own risk.

Probably safer to use ssh keys with putty. No plain-text login info revealed. Still not completely secure since someone could copy that file, but it's certainly better than using a plain-text password.

The best option is to use Slax-Dude's approach, using a *regular user* to login via ssh (via an ssh key preferably). You can then run `sudo shutdown -h now` assuming your sudoers file is setup properly to allow that command to be run without requiring a password.

user100 11-10-2010 12:51 AM

Thanks Slax-Dude and the other posters, that will work I think. :)


All times are GMT -5. The time now is 10:45 AM.