Jump to content
XPEnology Community

cant poweroff my nas remotely with plink since 6.0


mgrobins
 Share

Recommended Posts

Hi,

 

I have been running a batch command on my PC to power off my NAS after some actions on the PC are complete. Upgrading to DSM 6 has broken this as I can no longer use root access through plink.exe.

 

The commands I have been using are:

C:\SSH_stuff\plink 192.168.1.2 -l admin -pw XXXXXX poweroff

or

echo n | C:\SSH_stuff\plink.exe -P 22 -ssh -pw XXXXX admin@192.168.1.2 "shutdown -h now"

 

Both come back as "root access denied".

 

Synology knowledge base advices for SSH to use "Sudo -I" to gain root access however I am not certain how to structure my plink.exe commands to achieve this as well as run the power off command.

 

I tried the following and some derivatives with the -t which cleared up the ttl errors associated with sudo but could not get it to accept a password.

 

echo n | C:\SSH_stuff\plink.exe -P 22 -t -ssh -pw XXXXX admin@192.168.1.2 "sudo -I" "poweroff"

 

Hopefully someone can assist :smile:.

 

Another potential method would be to have a script on my NAS I can run that enables root access or runs the poweroff command? If so ... advice on that would be helpful too - I'm pretty much a non Linux user after so many years absence from it :smile:

 

I thnk this will be useful for anyone who needs root access and wants to run commands.

Link to comment
Share on other sites

 Share

×
×
  • Create New...