NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

PMNG's avatar
PMNG
Aspirant
May 30, 2019

NAS102 CLI close down

Hi All,

Just installed my first NAS, a 2nd hand NAS102 whixh is near my modem in another room.

 

With WakeMeOnLan.exe I can switch it on remotely with a single click on a CMD shortcut.

 

I cannot find a way to shut it down with the same ease, or have it shut down automatically after a certain time of no acitvity. Is there a way ( I don't want it running all the time ) ? Going into the admin page each time seems a waste of time :-)

 

Thanks,

Alex

 

2 Replies

Replies have been turned off for this discussion
  • StephenB's avatar
    StephenB
    Guru - Experienced User

    You can configure scheduled shutdowns (and startups) via the power tab in the admin web ui.

     

    If ssh is enabled on the NAS, you can use a utility called putty to send a shutdown command.

    https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

    https://the.earth.li/~sgtatham/putty/0.71/htmldoc/

     

    I haven't tried using putty for this - so check the manual. But I believe the right windows CLI command would be 

    putty.exe -ssh -2 -l root -pw nas-admin-password -m c:remote.cmd nas-ip-address

    remote.cmd is a file on the PC that has the shutdown command in it.  I suggest using rnutil rn_shutdown

     

    You can also do this from the putty gui (there is an option to enter a remote command there also).  But it would be easier to script it if you use the putty CLI interface.

     

     

    • PMNG's avatar
      PMNG
      Aspirant

      Thanks for helping StephenB  !

       

      For anyone reading this in the future:

      For me the "scheduled shutdowns (and startups) via the power tab" were no option. I want to do it (for now manually) before closing down my pc.

      So here is my magic formula (there might be others, this worked for me):

      Like Stephen said:

      - download Putty, make sure the PATH enviromental is set.

      - turn on SSH on the NAS

      then make a new shortcut (right click in explorer, new>shortcut) and give it this value:

      cmd.exe /c plink -ssh -2 -batch IpAdressToNas -l root -pw YourPassword rnutil rn_shutdown

      ( off course change the IpAdressToNas (can also be found by WakeMeOnLan) and YourPassword )

      then call it CloseNas or something of your liking. Double Click it and the NAS will close.

      some explaining:

      /c = no terminal window  (for testing you can use /k instead)

      -ssh = force using SSH

      -2 = force SSH V2

      -batch = ignore the "press return to start the session"

      -l = user

      -pw = password :-)

       

      Enjoy

      Alex

       

       

       

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More