sftpserver is a simple, single-threaded SFTP server built upon Paramiko's SFTPServer, primarily designed for testing Python SFTP clients rather than production environments. The current version is 0.3, with its last release in April 2017, indicating a maintenance-only status with no active development or new features.
pip install sftpserverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to start the sftpserver programmatically, generating a temporary RSA key if one doesn't exist. It will listen on 127.0.0.1:3373 by default. Connect with a client using any username/password (e.g., 'admin'/'admin') as the default handler accepts all credentials.
For production, consider robust SFTP server solutions (e.g., OpenSSH, commercial products) or actively maintained Python libraries like `asyncssh` or `pysftpserver` which offer more features and better concurrency.
Generate an RSA private key using `openssl req -newkey rsa:2048 -nodes -keyout /tmp/test_rsa.key -x509 -days 365 -out /tmp/test_rsa.key.pub` or `paramiko.RSAKey.generate(2048).write_private_key_file(key_path)` and provide its path to the server.
Avoid using this library for sensitive data. If used for testing, ensure the client explicitly allows older, weaker ciphers/algorithms if connection issues arise, or configure your client to disable strict host key checking for local testing (e.g., `StrictHostKeyChecking no` for `sftp` clients) for ephemeral test servers.