Member-only story
SFTP Files Transfer Using Python
My article is for everyone! Non-members can click on this link and jump straight into the full text!!
SFTP (Secure File Transfer Protocol) is a secure method of transferring files over the internet. Paramiko is a Python library that provides a secure way to communicate with remote servers using various protocols, including SFTP. In this blog, we will discuss how to use Paramiko to connect, transfer, download and remove files securely using SFTP.
There are two libraries for playing with SFTP file transfer in Python
1. Paramiko: It is well-managed and continuously updated to support the new version of Python.
2. Pysftp: But in the case of Pysftp we can get less than Python 3.5 version.
For this article, we are going to use Paramiko to demonstrate how to connect, transfer, upload and remove files from an SFTP server.
Setting Up Paramiko:
- Before we can use Paramiko, we need to install it.
- Paramiko can be installed using pip, the Python package installer.
- To install Paramiko, open a command prompt or terminal window and run the following command:
pip install paramiko