{ "info": { "author": "Scott Duckworth", "author_email": "sduckwo@clemson.edu", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=============\ndjango-sshkey\n=============\n\ndjango-sshkey allows you to associate multiple SSH public keys with Django\nuser accounts. It provides views to list, add, edit, and delete keys, each of\nwhich is intended for end-user consumption. It also provides a lookup view\nand corresponding lookup commands that are suitable for use with the\n``AuthorizedKeysCommand`` feature in OpenSSH_ 6.2 and above.\n\nThe Django app\n==============\n\nTo use django-sshkey in your Django project, simply add ``django_sshkey`` to\n``INSTALLED_APPS`` in ``settings.py``, map the URLs into your project, and\nprovide templates for the views (example templates are provided in the source).\n\nIn order to associate an incoming public key with a user you must define\n``SSHKEY_AUTHORIZED_KEYS_OPTIONS`` in your project's ``settings.py``. This\nshould be a string containing options accepted by sshd, with ``{username}``\nbeing replaced with the username of the user associated with the incoming\npublic key.\n\ndjango-sshkey can also help you keep track of when a key was last used.\n``SSHKEY_AUTHORIZED_KEYS_OPTIONS`` also replaces ``{key_id}`` with the key's\nid. The command that is run can then notify django-sshkey that the key was used\nby issuing a HTTP POST to the lookup URL, placing the key_id in the request\nbody.\n\nFor instance::\n\n SSHKEY_AUTHORIZED_KEYS_OPTIONS = 'command=\"my-command {username} {key_id}\",no-pty'\n\nin settings.py will cause keys produced by the below commands to look similar\nto::\n\n command=\"my-command fred 15\",no-pty ssh-rsa AAAAB3NzaC1yc2E...\n\nsshd would then verify the key is correct and run ``my-command``.\n``my-command`` would then know that this is fred and that he is using key 15,\nand could tell django-sshkey to update the last_used field of that key by\nrunning the equivalent of this command::\n\n curl -d 15 http://localhost:8000/sshkey/lookup\n\nYour URL may vary depending upon your configuration.\n\nURL Configuration\n-----------------\n\nThis text assumes that your project's ``urls.py`` maps ``django_sshkey.urls``\ninto the URL namespace as follows::\n\n import django_sshkey.urls\n urlpatterns = patterns('',\n ...\n url('^sshkey/', include(django_sshkey.urls)),\n ...\n )\n\nYou will need to adjust your URLs in the examples below if you use a different\nmapping.\n\n.. WARNING::\n\n The ``/sshkey/lookup`` URL can expose all public keys that have\n been uploaded to your site. Although they are public keys, it is probably a\n good idea to limit what systems can access this URL via your web server's\n configuration. Most of the lookup methods below require access to this URL,\n and only the systems that need to run the lookup commands should have access\n to it.\n\nSettings\n--------\n\n``SSHKEY_AUTHORIZED_KEYS_OPTIONS``\n String, optional. Defines the SSH options that will be prepended to each\n public key. ``{username}`` will be replaced by the username; ``{key_id}``\n will be replaced by the key's id. New in version 2.3.\n\n``SSHKEY_ALLOW_EDIT``\n Boolean, defaults to ``False``. Whether or not editing keys is allowed.\n Note that no email will be sent in any case when a key is edited, hence the\n reason that editing keys is disabled by default. New in version 2.3.\n\n``SSHKEY_DEFAULT_HASH``\n String, either ``sha256``, ``md5``, or ``legacy`` (the default). The default\n hash algorithm to use for calculating the finger print of keys. Legacy\n behavior enforces OpenSSH's pre-6.8 behavior of MD5 without the ``MD5:``\n prefix. New in version 2.5.\n\n``SSHKEY_EMAIL_ADD_KEY``\n Boolean, defaults to ``True``. Whether or not an email should be sent to the\n user when a new key is added to their account. New in version 2.3.\n\n``SSHKEY_EMAIL_ADD_KEY_SUBJECT``\n String, defaults to ``\"A new key was added to your account\"``. The subject of\n the email that gets sent out when a new key is added. New in version 2.3.\n\n``SSHKEY_FROM_EMAIL``\n String, defaults to ``DEFAULT_FROM_EMAIL``. New in version 2.3.\n\n``SSHKEY_SEND_HTML_EMAIL``\n Boolean, defaults to ``False``. Whether or not multipart HTML emails should\n be sent. New in version 2.3.\n\nTemplates\n---------\n\nExample templates are available in the ``templates.example`` directory.\n\n``sshkey/userkey_list.html``\n Used when listing a user's keys.\n\n``sshkey/userkey_detail.html``\n Used when adding or editing a user's keys.\n\n``sshkey/add_key.txt``\n The plain text body of the email sent when a new key is added. New in version\n 2.3.\n\n``sshkey/add_key.html``\n The HTML body of the email sent when a new key is added. New in version 2.3.\n\nManagement commands\n-------------------\n\n``import_sshkey [--auto-resolve] [--prefix PREFIX] [--name NAME] USERNAME KEY_PATH ...``\n Imports SSH public keys to tie to a user. If ``--auto-resolve/-a`` are given,\n attempt to generate unique key names using a UUID. The prefix used during\n this process is the key name, but can be changed using ``--prefix/-p``.\n\n``normalize_sshkeys [USERNAME KEY_NAME]``\n Recalculates key data to reflect a changed setting, for instance, if you have\n changed ``SSHKEY_DEFAULT_HASH`` and some keys have incorrect fingerprints in\n your database. Given no arguments, all keys will be normalized. The username\n asnd key name are optional, and if specified, will limit affected keys to\n those owned by a user, or a particular key of a user. This can also be done\n via the administration panel, but if you have a large key database the\n request could end up timing out.\n\nTying OpenSSH to django-sshkey\n==============================\n\nThere are multiple methods of connecting OpenSSH to django-sshkey. All of the\nmethods listed here require the use of the ``AuthorizedKeysCommand`` directive\nin ``sshd_config`` present in OpenSSH 6.2 and above. Please note that the\ncommand that is referenced by this directive and its ancestor directories must\nbe owned by root and writable only by owner.\n\nUnless otherwise stated, all of the methods below use the ``SSHKEY_LOOKUP_URL``\nenvironment variable to determine the URL of the ``/sshkey/lookup`` URL. If\nthis environment variable is not defined then it will default to\n``http://localhost:8000/sshkey/lookup``. If this environment variable is\ndefined in the sshd process then it will be inherited by the\n``AuthorizedKeysCommand``.\n\nAdditionally, all of the methods below use either ``curl`` (preferred) or\n``wget``. Some commands also use ``ssh-keygen``. These commands must be\npresent in ``PATH``.\n\nIf you would prefer not to use these external commands then there are variants\nof the lookup commands implemented purely in Python. However, they are *much*\nslower. To use the variants, replace ``lookup`` with ``pylookup``. For\nexample, use ``django-sshkey-pylookup-all`` instead of\n``django-sshkey-lookup-all``.\n\nUsing ``django-sshkey-lookup``\n------------------------------\n\n::\n\n Usage: django-sshkey-lookup -a URL\n django-sshkey-lookup -u URL USERNAME\n django-sshkey-lookup -f URL FINGERPRINT\n django-sshkey-lookup URL [USERNAME]\n\nThis program has different modes of operation:\n\n``-a``\n Print all public keys.\n\n``-u``\n Print all public keys owned by the specified user.\n\n``-f``\n Print all public keys matching the specified fingerprint.\n\nDefault\n Compatibility mode. If the username parameter is given then print all public\n keys owned by the specified user; otherwise perform the same functionality as\n ``django-sshkey-lookup-by-fingerprint`` (see below).\n\nStarting with OpenSSH 6.9 and above, the ``AuthorizedKeysCommand`` directive\nsupports the use of user-specified command line arguments, and different\ndetails about the authentication attempt are available to pass to the program.\nThis makes ``django-sshkey-lookup`` a good fit for later versions of the\nOpenSSH server.\n\n::\n\n # Show all available public keys\n AuthorizedKeysCommand /usr/local/bin/django-sshkey-lookup -a URL\n\n # Filter keys owned by Django user (assuming the user matches)\n AuthorizedKeysCommand /usr/local/bin/django-sshkey-lookup -u URL %u\n\n # Filter keys matching a sha256 fingerprint\n AuthorizedKeysCommand /usr/local/bin/django-sshkey-lookup -f URL %f\n\n.. note::\n\n If you choose to use OpenSSH's ``%f`` to filter by key fingerprint, know that\n it provides the sha256 fingerprint of the key by default. You can change the\n ``FingerprintHash`` directive in ``sshd_config`` to ``md5``, but in either\n case you will need to set django-sshkey's ``SSHKEY_DEFAULT_HASH`` setting to\n ``sha256`` or ``md5`` to match. By default, django-sshkey emulates OpenSSH's\n pre-6.8 fingerprint behavior, which is a slightly different representation of\n an md5 hash. This is so it is backwards-compatible with its pre-2.5 behavior.\n\nAll modes expect that the lookup URL be specified as the first non-option\nparameter.\n\nThis command is compatible with the old script ``lookup.sh`` but was renamed\nto have a less ambiguous name when installed system-wide. A symlink is left in\nits place for backwards compatibility.\n\nUsing ``django-sshkey-lookup-all``\n----------------------------------\n\n``Usage: django-sshkey-lookup-all``\n\nThis program prints all SSH public keys that are defined on your site. sshd\nwill have to scan through all of them to find the first match, so with many\nkeys this method will be slow. However, it does not require a patched OpenSSH\nserver.\n\nThis program:\n\n* can be used directly with pre-6.9 ``AuthorizedKeysCommand`` (the username\n parameter is ignored).\n\n* does not require a patched OpenSSH server.\n\n* does not scale well to a large number of user keys.\n\nUsing ``django-sshkey-lookup-by-username``\n------------------------------------------\n\n``Usage: django-sshkey-lookup-by-username USERNAME``\n\nThis program prints all SSH public keys that are associated with the specified\nuser.\n\nThis program:\n\n* can be used directly with pre-6.9 ``AuthorizedKeysCommand``.\n\n* does not require a patched OpenSSH server.\n\n* is ideal if each Django user corresponds to a system user account.\n\nUsing ``django-sshkey-lookup-by-fingerprint``\n---------------------------------------------\n\n``Usage: django-sshkey-lookup-by-fingerprint``\n\nThis program prints all SSH public keys that match the given fingerprint. The\nfingerprint is determined by the first of the following that is found:\n\n1. The ``SSH_KEY_FINGERPRINT`` environment variable, which should contain the\n MD5 fingerprint of the key (this is the second field generated by\n ``ssh-keygen -l``).\n\n2. The ``SSH_KEY`` environment variable, which should contain the key in\n standard openssh format (the same format as ``~/.ssh/id_rsa.pub``), is sent\n to ``ssh-keygen -l`` to determine the fingerprint.\n\n3. The key in standard openssh format is read from standard input and is sent\n to ``ssh-keygen -l`` to determine the fingerprint.\n\nThis program:\n\n* can be used directly with ``AuthorizedKeysCommand`` (the username parameter\n is ignored).\n\n* requires a patched OpenSSH server; compatible patches can be found at one of\n the following locations:\n\n - openssh-akcenv_ (this is the preferred patch)\n - openssh-stdinkey_\n\n* is ideal if you want all Django users to access SSH via a shared system user\n account and be identified by their SSH public key.\n\n.. _OpenSSH: http://www.openssh.com/\n.. _openssh-akcenv: https://github.com/ScottDuckworth/openssh-akcenv\n.. _openssh-stdinkey: https://github.com/ScottDuckworth/openssh-stdinkey", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ClemsonSoCUnix/django-sshkey", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-sshkey", "package_url": "https://pypi.org/project/django-sshkey/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-sshkey/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ClemsonSoCUnix/django-sshkey" }, "release_url": "https://pypi.org/project/django-sshkey/2.5.0/", "requires_dist": null, "requires_python": null, "summary": "Associates multiple SSH public keys with Django user accounts.", "version": "2.5.0" }, "last_serial": 2173119, "releases": { "2.2.0": [ { "comment_text": "", "digests": { "md5": "678a8c7fb6b7c4c5f69cfdb2968c270d", "sha256": "7d0fb1ca542720b231c32a5d788a70cc062b6fbc9b46480a8d8a53821a316787" }, "downloads": -1, "filename": "django-sshkey-2.2.0.tar.gz", "has_sig": false, "md5_digest": "678a8c7fb6b7c4c5f69cfdb2968c270d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13543, "upload_time": "2014-03-26T16:42:09", "url": "https://files.pythonhosted.org/packages/b9/28/65435d471c06cecb6d5f3adf59df66947c1a531aa7bbd191a373dd37c581/django-sshkey-2.2.0.tar.gz" } ], "2.3.0": [ { "comment_text": "", "digests": { "md5": "2b361c764aca1d21fd98d7ac2a601b0f", "sha256": "4aecb7b517f6d346cc986b1fae4cdba992a10d8d4e3775f2c18b9d6a352cf09c" }, "downloads": -1, "filename": "django-sshkey-2.3.0.tar.gz", "has_sig": false, "md5_digest": "2b361c764aca1d21fd98d7ac2a601b0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20256, "upload_time": "2014-07-07T20:27:39", "url": "https://files.pythonhosted.org/packages/e4/97/a2fa45642a26d3678334a7d2c789630de678a94d67aac59fbc4dc2b7eeda/django-sshkey-2.3.0.tar.gz" } ], "2.3.1": [ { "comment_text": "", "digests": { "md5": "334e4a0619b6208004e1f2444cad1b15", "sha256": "e2c4644d8ca2dd81ee1ff5656986116b565bc17ed54d6a9649578232c3c76b2b" }, "downloads": -1, "filename": "django-sshkey-2.3.1.tar.gz", "has_sig": false, "md5_digest": "334e4a0619b6208004e1f2444cad1b15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20296, "upload_time": "2014-07-29T21:14:27", "url": "https://files.pythonhosted.org/packages/cc/32/1831558222433fb930ecf9622c39493cb7d161ef1ce73fa8a568c30e6a13/django-sshkey-2.3.1.tar.gz" } ], "2.3.2": [ { "comment_text": "", "digests": { "md5": "0ae6800cebfe9cd2c39fc2baa4084dec", "sha256": "cfb008b7ec42b405e336c412980d84ead938658194a91e007701e4e3336b13e3" }, "downloads": -1, "filename": "django-sshkey-2.3.2.tar.gz", "has_sig": false, "md5_digest": "0ae6800cebfe9cd2c39fc2baa4084dec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21213, "upload_time": "2014-09-15T19:36:49", "url": "https://files.pythonhosted.org/packages/0a/5d/fa6bb8ef76ddda6e55823674239329a53b83978c6d208fcc7e21a4c0fb41/django-sshkey-2.3.2.tar.gz" } ], "2.4.0": [ { "comment_text": "", "digests": { "md5": "121c906c6c5fa39fba81ed1848078151", "sha256": "52fce56bde7725487e64f8282ede77da6c96112aaf969f6913665cd7fc9774fd" }, "downloads": -1, "filename": "django-sshkey-2.4.0.tar.gz", "has_sig": false, "md5_digest": "121c906c6c5fa39fba81ed1848078151", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22124, "upload_time": "2015-09-22T01:28:53", "url": "https://files.pythonhosted.org/packages/f9/9b/fb6f41a97993e3ab04fdf76773dd6ab380c722e80c79239b8bb4e1c8bd2b/django-sshkey-2.4.0.tar.gz" } ], "2.5.0": [ { "comment_text": "", "digests": { "md5": "5ebaca0745152b7ce7c0ab008f663185", "sha256": "31e09c3d323bc2f92bf85d4314a5ccd5ef76cb085d653c6103173553f7518b94" }, "downloads": -1, "filename": "django-sshkey-2.5.0.tar.gz", "has_sig": false, "md5_digest": "5ebaca0745152b7ce7c0ab008f663185", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26791, "upload_time": "2016-06-17T13:46:00", "url": "https://files.pythonhosted.org/packages/42/f5/98b55316635ce253d2e2ed0b73c03f17f79abbbf0ff5b1189605c658ebca/django-sshkey-2.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5ebaca0745152b7ce7c0ab008f663185", "sha256": "31e09c3d323bc2f92bf85d4314a5ccd5ef76cb085d653c6103173553f7518b94" }, "downloads": -1, "filename": "django-sshkey-2.5.0.tar.gz", "has_sig": false, "md5_digest": "5ebaca0745152b7ce7c0ab008f663185", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26791, "upload_time": "2016-06-17T13:46:00", "url": "https://files.pythonhosted.org/packages/42/f5/98b55316635ce253d2e2ed0b73c03f17f79abbbf0ff5b1189605c658ebca/django-sshkey-2.5.0.tar.gz" } ] }