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.0.tar.gz (4.4 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.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyftpdlibsqladdon-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 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.0.tar.gz
Algorithm Hash digest
SHA256 91c18ef320085f839d22d64e25d15e8b766566955f9991ac51797ada5b3b5639
MD5 cfc265210c779126f78b146dc0e38b17
BLAKE2b-256 3cf2130c18482302316a5309fbf177f800a5602263bffbcf01ec55cf2e1db390

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyftpdlibsqladdon-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b284925917d1a15675f52e31b7a34a31fa9a5f536a87aba9135320b70e73da5f
MD5 a6faf25450595ba62ddc30fe6386169f
BLAKE2b-256 2777caaf556879d2dc200b6a8b4219f5d17ede30f5d69680418833c68ead06db

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