Skip to main content

XFTPD Server: SFTP and FTP server Class that can be started and stopped programmatically.

Project description


As a network automation engineer, do you get frustrated at not having instant access to an SFTP/FTP server when you need it most?!

Well look no further!

Simple, Secure, and Randomized...

Right at your fingertips, and ready for API integrations, you have come to the right Python Module!

XFTPD Server

SFTP and FTP server Class that can be started and stopped programmatically

With randomized username, password, RSA keys

Ideal for on-demand SFTP and FTP and file transfers

SFTP Example

>>> from ftp_server import SftpServer
>>> SFTP = SftpServer('/tmp',2222)
>>> SFTP.level = 'DEBUG'
>>> SFTP.start()
>>> print(SFTP.Addr)
>>> print(SFTP.user)
>>> print(SFTP.Pass)

Example connecting to SFTP server

[root@CentOS]# sftp -P 2222 w7Kg0Fo4Xp6Xo9C@
The authenticity of host '[]:2222 ([]:2222)' can't be established.
RSA key fingerprint is SHA256:khgoV/GQIShUf4KWr2ZqvpI68KMUFRsedwx4E0hWgi0.
RSA key fingerprint is MD5:d2:45:1b:d8:44:66:5f:66:b9:5e:8d:33:fb:01:0b:b1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[]:2222' (RSA) to the list of known hosts.
w7Kg0Fo4Xp6Xo9C@'s password:
Connected to
sftp> dir             
sftp> bye

FTP Example

Python 3.7.4 (default, Sep  7 2019, 18:27:02)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ftp_server import FtpServer
>>> FTP = FtpServer('/tmp')
>>> FTP.start()
[I 2020-07-15 21:14:48] concurrency model: multi-thread
[I 2020-07-15 21:14:48] masquerade (NAT) address: None
[I 2020-07-15 21:14:48] passive ports: None
>>> print(SFTP.Addr)
>>> print(FTP.user)
>>> print(FTP.Pass)

When the stop() function is called, the thread will print an Exception to STDOUT, but this will not be an Exception for the codeblock calling the function

>>> Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/", line 926, in _bootstrap_inner
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/blah/TEMP/", line 17, in _run_server
  File "/usr/local/lib/python3.7/site-packages/pyftpdlib/", line 478, in serve_forever
    self.ioloop.loop(timeout, blocking)
  File "/usr/local/lib/python3.7/site-packages/pyftpdlib/", line 343, in loop
  File "/usr/local/lib/python3.7/site-packages/pyftpdlib/", line 709, in poll
OSError: [Errno 9] Bad file descriptor


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xftpd-0.0.3.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

xftpd-0.0.3-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page