“ping” isn't allowed to be executed

霸气de小男生 提交于 2019-12-04 13:42:59

Paramiko's exec_command(cmd) will invoke /the/login/shell -c cmd to run the command which is similar to ssh user@host cmd. If your login shell on the remote server does not support -c then exec_command() would fail. So before using exec_command() I usually first try ssh user@host cmd from the command line.

invoke_shell() would work because it starts an interactive session just like you connect to the server manually with PuTTY.

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