So interagieren Sie mit ssh mithilfe des Subprozessmoduls
Ich versuche, einen untergeordneten ssh-Prozess mithilfe eines Unterprozesses zu erzeugen.
Ich arbeite an Python 2.7.6 unter Windows 7
Hier ist mein Code:
from subprocess import *
r=Popen("ssh sshserver@localhost", stdout=PIPE)
stdout, stderr=r.communicate()
print(stdout)
print(stderr)
Die Ausgänge:
None
stdout sollte enthalten: sshserver @ localhosts Passwort: