Skip to content
Advertisement

Paramiko return code127 against command that actually exist

During automating SSH routine using paramiko to linux pc, I am encountering an issue where for the existing command, I am not able to execute it successfully as “command not found” 127 response code is received on command execution.

I have tried all sort of ways exec_command(), crosschecking manually (the command work fine), change directory to the path of command before execution, still no luck.

However, the same command works well with Java. Any thoughts on it.

Advertisement

Answer

Not sure what your real problem is but you can use full pathname to the command which is supposed to always work. Like

exec_command('/bin/ls')
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement