请选择 进入手机版 | 继续访问电脑版

理解sftp in Python||paramiko

[复制链接]
太阳神鹰 发表于 2021-1-3 12:14:21 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

  • 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
       
    1. # download from remote to localsftp> get remoteFile localFile# transfering localfile to remotesftp> 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实现上传和下载功能
       
    此中:
    1. sf.connect(username=username, password=password)
    复制代码
    需要指定key,不能直接写sf.connect(username, password), 因为connect的第一个参数并不是username。
    别的,sftp.put(local, remote)内里的local,remote都需要包罗file。

来源:https://blog.csdn.net/The_Time_Runner/article/details/112072678
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题

专注素材教程免费分享
全国免费热线电话

18768367769

周一至周日9:00-23:00

反馈建议

27428564@qq.com 在线QQ咨询

扫描二维码关注我们

Powered by Discuz! X3.4© 2001-2013 Comsenz Inc.( 蜀ICP备2021001884号-1 )