Jump to content
XPEnology Community

[SOLVED] Remote shutdown for Win users (Telnet or SSH wRSA)


toshas

Recommended Posts

There are some people's which is not familiar with linux.

 

This remote shutdown solution can be useful for them.

 

Solution was found here:

http://www.synology-forum.de/showthread ... ing-Telnet

Telnet Scripting Tool a.k.a TST10.exe

http://jerrymannel.com/blog/2008/11/11/ ... -tst10exe/

 

1. On synology go to Control Panel/Network Services Folder/Terminal Services and enable the Telnet Service

http://forum.synology.com/wiki/index.ph ... _Interface

2. download TST10.zip - Telnet Scripting Tool

3. write you own script (shutdown.txt) like this

 

192.168.1.10 23
WAIT "login:"
SEND "root\m"
WAIT "assword:"
SEND "MyPassword\m"
WAIT ">"
SEND "poweroff\m"
WAIT ">"

 

4. create .bat file with right path to TST10.exe

C:/../TST10/tst10 /r:shutdown.txt

 

5. shutdown your synology by double-click on .bat file

 

 

p.s. there is report about weak telnet security

http://wrgms.com/post/37501692643/synol ... t-password

I can't confirm this on my setup (Trantor v1.2 repack).

TST10.zip

Edited by Guest
Link to comment
Share on other sites

  • 2 weeks later...

Solution that allows you login via SSH with a RSA keypair was found here:

 

http://www.mauchle.name/blog/?p=239

 

1. Download PuTTY and PuTTYgen (or just get the installer, everything is in there) from here http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

 

2. Generate a keypair with PuTTYgen (Parameters: SSH-2 RSA)

 

3. Save the private key as “myprivatekey.ppk”

 

4. Copy the public key to the clipboard. Looks somewhat like this:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAzP4MR3lkCD2pa7nwT3NMjjDBMmEuJ4exW4GKBBP+okArZ/IrjbLIpdh8ahpfgjh8kM//OVUGeRa1GigzcCuGzIa2YfS7L4Q9cbUUWFwIu2hGV3ZpJ2xDZExaaLH90Vw+ZBaozD2OI4FZ1Dqh8Bj29SQqIIbmxf/ASyTmXHZCbQk= rsa-key-20130414

 

5. Connect to your diskstation with PuTTY

diskstation:22

 

6. Login as root

 

7. Edit the SSH config with

vi /etc/ssh/sshd_config

 

8. Look for the following lines

#RSAAuthentication yes

#PubkeyAuthentication yes

#AuthorizedKeysFile .ssh/authorized_keys

 

9. Change them to this (by hitting “x” when the cursor is over the # and hitting ESC, then typing :wq ENTER)

#RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile .ssh/authorized_keys

 

10. Go to /root and create the .ssh folder

cd /root

mkdir .ssh

 

11. Edit the keyfile

vi /root/.ssh/authorized_keys

 

12. Press “i”

 

13. Paste your public key and save the file (Hit Esc, type :wq, hit Enter)

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAzP4MR3lkCD2pa7nwT3NMjjDBMmEuJ4exW4GKBBP+okArZ/IrjbLIpdh8ahpfgjh8kM//OVUGeRa1GigzcCuGzIa2YfS7L4Q9cbUUWFwIu2hGV3ZpJ2xDZExaaLH90Vw+ZBaozD2OI4FZ1Dqh8Bj29SQqIIbmxf/ASyTmXHZCbQk= rsa-key-20130414

 

14. Set the access-rights to the file

chmod 700 /root/.ssh

chmod 644 /root/.ssh/authorized_keys

 

15. Disconnect with

exit

 

16. Open Putty again and make the following settings

 

Hostname: or

Port: 22

Connection type: SSH

Connection->Data->Auto-login username: root

Connection->SSH->Auth->Private Key: Your Keyfile

And save the session as

 

17. Create a new shortcut on your desktop with the following target

"C:\Program Files (x86)\PuTTY\putty.exe" -load "sessionname"

 

18. Finished. From now on you can connect by double-clicking.

 

All steps can be done via ssh or telnet.

 

At step 16

Connection->SSH->Remote command:

allows you to send different commands after login

for shutdown it should be

nohup poweroff > /dev/null 2>&1 &

 

For more complex command set

"C:\Program Files (x86)\PuTTY\putty.exe" -load "sessionname" -m C:\commands.txt

 

If you don't want to close session immediately, change

Connection->Close windows on exit: Always/Never/On clean exit

 

 

SSH with a RSA keypair login is more secure than Telnet.

 

p.s. with this thread

Turn on your XPEnology with *double-click*

http://xpenology.com/forum/viewtopic.php?f=2&t=1330

Win users have complete 'double-click' solution for turn-on/turn-off their synology

Link to comment
Share on other sites

×
×
  • Create New...