理解sftp in Python||paramiko

  • FTP

    The File Transfer Protocol (FTP) is a standard network protocol used for the transfer of computer files between a client and server on a computer network.

    FTP is built on a client-server model architecture using separate control and data connections between the client and the server.

  • sftp

  • SSH File Transfer Protocol

    The SSH File Transfer Protocol ( also Secure File Transfer Protocol, or SFTP) is a network protocol that provides file access, file transfer, and file management over any reliable data stream.

    It was designed by the Internet Engineering Task Force as an extension of the Secure Shell Protocol version 2.0 to provide secure file transfer capabilities.

    Compared to the SCP protocol, which only allows file transfers, the SFTP protocol allows for a range of operations on remote files which make it more like a remote file system protocol.

  • Secure file transfer program

    sftp is a command-line interface client program to transfer files using the SSH File Transfer Protocol (SFTP), which runs inside the encrypted Secure Shell connection.

    It provides an interactive interface similar to that of traditional command-line FTP clients.

  • Transferring Files with SFTP

    How To Use SFTP to Securely Transfer Files with a Remote Server

    # download from remote to local
    sftp> get remoteFile localFile
    # transfering localfile to remote
    sftp> put localFile
    
  • Paramiko on Python

    Paramiko is a Python implementation of the SSHv2 protocol, providing both client and server functionality.

    While it leverages a Python C extention for low level cryptography, Paramiko itself is a pure Python interface around SSH networking concepts.

    Python使用sftp实现上传和下载功能

    其中:

    sf.connect(username=username, password=password)
    

    需要指定key,不能直接写sf.connect(username, password), 因为connect的第一个参数并不是username

    另外,sftp.put(local, remote)里面的localremote都需要包含file

上一篇:sftp上传文件显示“Access is denied”的解决方法


下一篇:实践--Ubuntu 搭建SFTP服务