Ich möchte auf einem remoten Rechner mit einer ssh Verbindung die Ausgabe eines Programmes auf den lokalen Rechner übertragen.
Der Zugriss ist ohne Passwort möglich und in der shell funktioniert das Kommando, es ist also Parameterproblem, was ich derzeit nicht erkennen kann, da ich nicht so viel Erfahrung in Python habe.
ret=subprocess.run(["ssh", "raspberry@192.168.178.45", "-t", '"ls"|cat'], shell=True, capture_output=True, text=True, check=True)
subprocess.CalledProcessError: Command '['ssh', 'raspberry@192.168.178.45', '-t', '"ls"|cat']' returned non-zero exit status 255.
Hat jemand ein Tip für mich ?
ssh auf remote system mit output local mit Fehler
- __blackjack__
- User
- Beiträge: 14326
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
@franze_m: Das ``shell=True`` ist falsch und das ``cat`` ebenfalls.
„Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.“ — Brian W. Kernighan
