Skip to main content

Module for implementing FTP users in pyftpdlib through a SQL server

Project description

pyftpdlibsqladdon

Module for implementing FTP users in pyftpdlib through a SQL server

Installation


pip install pyftpdlibsqladdon

Get started

How to start pyftpdlib with user support via SQL

from pyftpdlib.handlers import FTPHandler

from pyftpdlib.servers import FTPServer

from pyftpdlibsqladdon import DummySqlAuthorizer



def main():

    #define DummySqlAuthorizer

    authorizer = DummySqlAuthorizer()

    #add SQL server configuration

    authorizer.add_sql_config('host_ip','database','sql_user','sql_password')

    #add SQL column names where data is stored

    authorizer.add_sql_query('table','user_column','password_column','home_path_column','permission_colum')

    handler = FTPHandler

    handler.authorizer = authorizer

    server = FTPServer(('', 21), handler)

    server.serve_forever()



if __name__ == "__main__":

    main()

Considerations

This authorizer cannot be used in conjunction with DummyAuthorizer, as it overwrites the virtual table of users with those obtained from the database.

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

pyftpdlibsqladdon-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyftpdlibsqladdon-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pyftpdlibsqladdon-0.1.1.tar.gz.

File metadata

  • Download URL: pyftpdlibsqladdon-0.1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for pyftpdlibsqladdon-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6d0ba98b0386a906016aa5e0fadb308509b0cd5f7283d6aee7e8a564f966358e
MD5 9cb4fa4569c424704da6440de24e7d85
BLAKE2b-256 36e99e7ee20c5633aa9a3ee53d19804beda8ab2058da25d351e1a14ed82eb6ed

See more details on using hashes here.

File details

Details for the file pyftpdlibsqladdon-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyftpdlibsqladdon-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 932bfd206b38f26f17283688fbd873a21c4bd90780558bcca4020e9c4a4a55ea
MD5 d0d2512a208799d00a5660f3735170e9
BLAKE2b-256 2af574a7b2c693a5087802902baf9c5440d5a0d975ef94f9f9fa7105ad21d80e

See more details on using hashes here.

Supported by

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