python - Why does paramiko return blank line while execute invalid command? -


i try use paramiko execute invalid command on remote server

import paramiko  ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) ssh.connect("10.10.11.15", 22, "admin", "net") stdin, stdout, stderr = ssh.exec_command("ls1") print stdout.read() ssh.close() 

however, returns blank line. how error message it?

thanks

usually error message printed stderr, not stdout. try printing instead.


Comments