1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Reboot Windows Computer Remotely through SSH running on Tomato?

Discussion in 'Networking Issues' started by threehappypenguins, Feb 21, 2014.

  1. threehappypenguins

    threehappypenguins Serious Server Member

    I have an SSH server running on Tomato and am able to create an SSH tunnel successfully through Putty. I know I can type the command "reboot" and it will reboot the router. Is there a command where I can reboot a Windows computer that is on that network? I know it's internet IP address.
  2. Eddie Seelke

    Eddie Seelke Reformed Router Member

    It is possible. I did something like this last year using FreeSSHd.

    Basically, you need to install an SSH server in Windows, like FreeSSHd, run it as a service and setup your Tomato router to connect using a key. Then you can issue commands in Tomato that will in turn run them on the PC.

    I had made a script called win_shutdown like this:
    for myHost in $1
      count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
        if [ $count -eq 1 ]; then
        ssh -i /jffs/id_rsa sshd@$myHost 'shutdown -s -t 120 -c "Computer will shutdown in two minutes!"'
    And then would use cron to run the command:
    /jffs/win_shutdown computer1.domain.lan
    Hope this helps. Let me know if you need more info.

    WilsonL likes this.

Share This Page