python - Paramiko equvalent of pipeline controls and input/output pipes -
I need a method of permikico-based file transfer with a light server (), for which there is no support or what There is a way to get a cat and style file transfer redirects, such as:
ssh server "cat remote_file" & gt; Local_file
with channels?
What can paramiko.Transport.open_channel () or message () work? I'm unsure about moving forward.
may be useful as a starting point (such as ./ Sshpipe host "command"):
#! / Usr / bin / env python import system import paramiko def sshpipe (host, line): client = paramiko.SSHClient () client.set_missing_host_key_policy (paramiko.AutoAddPolicy ()) client.connect (host) stdin, stdout, stderr = client Exec_command (Line) output = stdout.read () sys.stdout.write (output) stdin.close () stdout.close () stderr.close () client.close () sshpipe (sys.argv [1], sys Argv [2])
Comments
Post a Comment