Skip to main content

Administrative Services Over SSH for Twisted Python Applications

Create SSH Server public key / private key pair

Example:

$ mkdir keys
$ ckeygen -b 2048 -t rsa -f keys/id_rsa

Run Demos

Custom protocol over SSH:

$ twistd -ny ./txsshadmin/demo.tac

Manhole REPL over SSH:

$ ./txsshadmin/manhole_repl.py

Create Your Own SSH Service

Create a Protocol Handler

Subclass txsshadmin.proto_dispatcher.BaseHandler. Override handler methods you wish to customize. When the handler is created, the SSH avatar is assigned to its avatar attribute. Each handler method is passed an instance of the dispatcher.

Create a Protocol Factory

Use txsshadmin.proto_dispatcher.makeSSHDispatcherProtocolFactory() to create a protocol factory from your handler.

Create an SSH Avatar

Subclass txsshadmin.cred_base.SSHBaseAvatar to create an avatar for your ssh service. Assign the protocol factory you created to its protocolFactory attribute. The avatar is where you can define the capabilities of authenticated users. A protocol handler for a service with users with various capabilities may delegate its handlers to its avatar.

Create a Realm

The realm determines what avatar (if any) is returned when the authenticated avatar ID and a list of interfaces is provided to the realm. The resulting avatar should support at least one of the provided interfaces.

For a simple realm that returns only a single type of avatar, you can subclass txsshadmin.cred_base.SSHBaseRealm and set the avatarFactory attribute to an avatar factory. For more sophisticated realms, you can include logic that returns different avatars based on capabilities keyed to the avatar ID.

Create the SSH Service

Subclass txsshadmin.service.SSHServiceBase. Set the realm attribute equal to an instance of your realm.

Metadata

Release files for txsshadmin 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for txsshadmin 0.2.0
File Size Uploaded Provenance Actions
txsshadmin-0.2.0.tar.gz 7.5 kB Without provenance Details for txsshadmin-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for txsshadmin 0.2.0
File Interpreter ABI Platform Actions
txsshadmin-0.2.0-py3-none-any.whl Python 3 none any Details for txsshadmin-0.2.0-py3-none-any.whl

Total release size: 26.7 kB

Release files / txsshadmin-0.2.0.tar.gz

Download URL txsshadmin-0.2.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ca7ecda2e389596441b183d564d729afc367bce200ee68d952916db0bbefe06b
BLAKE2b-256 checksum
How to use checksums
6d6fce4ca195d314c1b16c09af072a4002c20168ce90eefdb3196856dc6933a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / txsshadmin-0.2.0-py3-none-any.whl

Download URL txsshadmin-0.2.0-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a39757142a907aefe2bb5e5268ec2391f680fa7d0b35bdc2c47edb7e937a153f
BLAKE2b-256 checksum
How to use checksums
0e26de0fc61a5b0076eb0e601d16cdca002e998e593f4ed49a26c80c08dc245e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Security for txsshadmin 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page