Ok, it was raining outside so got some time to test it.
What worked for me:
1) installed Alt-F sudo package
2) created an user called 'shutdown' in Alt-F administration directly (for me - easier than looking for a Linux command)
3) connected via ssh and used visudo to add this: shutdown ALL=NOPASSWD:/sbin/poweroff
4) calling it from Windows using PuTTY: plink.exe -l shutdown -pw PASSWORD SERVERNAME -m nas_shutdown.txt
where nas_shutdown.txt contains: sudo /sbin/poweroff
Not sure whether this is the ideal way but at least I am not sharing the root password within the command anymore. Only fake "shutdown" user's password.
Dne úterý, 21. ledna 2014 17:29:46 UTC+1 Lukas Trtik napsal(a):