Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在帕拉米科海峡开通更多管道_Python_Ssh_Pipe_Paramiko - Fatal编程技术网

Python 在帕拉米科海峡开通更多管道

Python 在帕拉米科海峡开通更多管道,python,ssh,pipe,paramiko,Python,Ssh,Pipe,Paramiko,当通过Paramiko连接到ssh服务器时,使用SSHClient读取stdios非常容易 client = paramiko.SSHClient() client.load_system_host_keys() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect('127.0.0.1', username='rusername', password='password') stdin, stdo

当通过Paramiko连接到ssh服务器时,使用
SSHClient
读取stdios非常容易

client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('127.0.0.1', username='rusername', password='password')
stdin, stdout, stderr = client.exec_command(cmd)
我可以通过
客户端访问使用过的
频道
。获取\u transport()。\u频道
(也许有更好的方法?)

有没有可能在这条通道上多开几条管道?我在ssh服务器上调用一个Python脚本,以便在服务器端脚本中打开fd进行编写

Channel.makefile()
在我所做的小测试中似乎与另一个管道/fd不相关。我可能误解了文档

要在远程服务器上打开文件(用于读取或写入),可以使用
open\u sftp

sftp = client.open_sftp()
with sftp.open("/tmp/somefile", "w") as outfile:
    outfile.write("my data")

如果我在服务器上创建一个命名管道,这可能会很有帮助,我可能会通过您的示例在客户机上读取它,然后从服务器代码中写入它。。。我只是希望有一个更精简的方法。