Python 从我的服务器下载文件以将服务器跳转到我的笔记本电脑

Python 从我的服务器下载文件以将服务器跳转到我的笔记本电脑,python,Python,我有一个复杂的环境。我需要在只能从跳转服务器访问的服务器上运行一些脚本 Web服务器(需要运行script/home/hno3.sh,生成文件/tmp/hno3.txt) 跳转服务器:将文件hno3.txt从Web服务器传输到此处 笔记本电脑:将文件hno3.txt从跳转服务器传输到此处 这是我写的,显然是不够的: import os import paramiko mycommand = raw_input("Enter your command ") excel = [] with open

我有一个复杂的环境。我需要在只能从跳转服务器访问的服务器上运行一些脚本

Web服务器(需要运行script/home/hno3.sh,生成文件/tmp/hno3.txt)

跳转服务器:将文件hno3.txt从Web服务器传输到此处

笔记本电脑:将文件hno3.txt从跳转服务器传输到此处

这是我写的,显然是不够的:

import os
import paramiko
mycommand = raw_input("Enter your command ")
excel = []
with open('server.txt') as f:
    for line in f:
        server = line.rstrip()
        username, password = ('ibmadmin', 'password')
        ssh = paramiko.SSHClient()

        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

        ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts")))

        ssh.connect(server, username=username, timeout=60)
        ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(mycommand)
        print "For Server " + server
        output1 = ssh_stdout.read()
        print ">", output1.rstrip()
        excel.append(output1.rstrip())

        ssh.close()
在执行时,我给scp命令,从Web服务器下载文件到跳转服务器

我无法理解如何在Web服务器上执行脚本。有没有办法从笔记本电脑登录到跳转服务器,然后登录到Web服务器来运行脚本?我的脚本将在笔记本电脑上运行