Executing command on Plink command line fails with “not found”

半世苍凉 提交于 2019-12-01 12:00:45

This is partly covered in this question:
Script via Plink in .bat behaves differently

So you can particularly try which poweroff in a normal session, to see where poweroff resides (can be /sbin/poweroff). And then use a full path in your plink command-line.


As your command-line does not work even with the -t switch, your SSH server must execute a command in "exec" channel (used when a command is provided on command-line or using -m switch) differently than in a "shell" channel. This is rather unusual.

You can force plink to use "shell" channel (like in an interactive session) by using an input redirection:

echo poweroff| plink ...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!