I am trying to use popen to interact with ssh. But it seems like there is not way to redirect stdoutput
proc = subprocess.Popen(["/usr/bin/ssh","192.168.254.1", "user"], stdout=PIPE, stdin=PIPE, stderr=PIPE, shell=False, bufsize=10000)
out, err = proc.communicate()
When I run the script both the output and the err are empty, and the command line is showing
user@192.168.254.1's password:
what am I doing wrong? It has the exact same behavior when I set shell=True. Also before people tell me to use pexpect of the pxssh I have tried those, and they won't work for my application. I am running this script inside a daemon service and pexpect fundamentally handles the T100 and linux control codes/escape characters differently, and in certain reproducable instances looses part of the byte stream.
Any help is appreciated. Thank you