Paramiko's SSHClient with SFTP

后端 未结 2 1923
日久生厌
日久生厌 2020-11-29 18:47

How I can make SFTP transport through SSHClient on the remote server? I have a local host and two remote hosts. Remote hosts are backup server and web server. I

2条回答
  •  难免孤独
    2020-11-29 19:12

    If you have a SSHClient, you can also use open_sftp():

    import paramiko
    
    
    # lets say you have SSH client...
    client = paramiko.SSHClient()
    
    sftp = client.open_sftp()
    
    # then you can use upload & download as shown above
    ...
    

提交回复
热议问题