Skip to main content

py-simple-sshd

py-simple-sshd is a compact SSH daemon implemented with Paramiko. It is meant for cases where you need an embeddable, cross-platform SSH entry point that can launch a configured local shell after public-key or password-file authentication.

Installation

pip install py-simple-sshd

Usage

simple-sshd \
  --host 0.0.0.0 \
  --port 2222 \
  --shell /bin/bash \
  --authorized-keys /etc/simple-sshd/authorized_keys

Use --root when the daemon and the shells it starts should run with administrator/root privileges:

simple-sshd --root --host 0.0.0.0 --port 22 --shell /bin/bash --authorized-keys /etc/simple-sshd/authorized_keys

On Windows, errors printed in the elevated --root console pause briefly before exit so the message remains visible.

simple-sshd is always single-user. Without --root, clients must authenticate as the current operating-system username. With --root, clients must authenticate as root on every platform, including Windows.

Password authentication is disabled unless --password-file is provided:

simple-sshd \
  --host 127.0.0.1 \
  --port 2222 \
  --shell /bin/bash \
  --authorized-keys ~/.ssh/authorized_keys \
  --password-file /etc/simple-sshd/password.txt

When both --authorized-keys and --password-file are configured, clients can authenticate with either a listed public key or the password read from the file. If --password-file is omitted, only public-key authentication is available.

On Windows, use a Windows shell path such as:

simple-sshd --host 127.0.0.1 --port 2222 --shell C:\Windows\System32\cmd.exe --password-file .\password.txt

Options

  • --host: address to bind, default 127.0.0.1
  • --port: TCP port to bind, default 2222
  • --shell: shell executable launched for authenticated sessions
  • --authorized-keys: OpenSSH authorized_keys file for public-key auth
  • --password-file: text file whose content is accepted as the SSH password
  • --host-key: private SSH host key; generated under ~/.simple-sshd if omitted
  • --root: relaunch the daemon with administrator/root privileges before serving
  • --log-level: DEBUG, INFO, WARNING, ERROR, or CRITICAL
  • --log-file: persistent log file, default ~/.simple-sshd/simple-sshd.log

Notes

  • Password files are read as UTF-8 text. Trailing line endings are removed, while other whitespace is preserved.
  • Host keys are persistent by default so clients can verify the server identity.
  • Runtime listener, client, and channel errors are logged and isolated so one failing connection does not stop the daemon.
  • The daemon rejects authentication attempts for any username other than its configured single login name.
  • ANSI/VT escape sequences, including color, bold, cursor movement, clear-screen commands, and raw ESC input, are forwarded through the SSH channel. PTY sessions set TERM from the client's pty request so terminal-aware programs can enable their normal ANSI behavior.
  • POSIX systems use a real pty for terminal sessions. Windows terminal sessions use pywinpty; non-pty sessions use standard process pipes.

Metadata

Release files for py-simple-sshd 0.1.9

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

Source distribution (sdist)

Source distribution for py-simple-sshd 0.1.9
File Size Uploaded Provenance Actions
py_simple_sshd-0.1.9.tar.gz 14.3 kB Without provenance Details for py_simple_sshd-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-simple-sshd 0.1.9
File Interpreter ABI Platform Actions
py_simple_sshd-0.1.9-py3-none-any.whl Python 3 none any Details for py_simple_sshd-0.1.9-py3-none-any.whl

Total release size: 31.1 kB

Release files / py_simple_sshd-0.1.9.tar.gz

Download URL py_simple_sshd-0.1.9.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4a0dd02eaa1fc7feedaee2e0664db52f3c983c6922fc9d164b21b46a24058669
BLAKE2b-256 checksum
How to use checksums
2a601fba2fa305e30237fc5fcf8d485aaaa516b321e4cbb2ca8df6512c66527b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Release files / py_simple_sshd-0.1.9-py3-none-any.whl

Download URL py_simple_sshd-0.1.9-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a151145f335af2b2571630129db93e28a80e031e76e492dbb6311ad93db4a2d
BLAKE2b-256 checksum
How to use checksums
629112b7c2575d44eff020d05317f2ebe98bea44c12a20d7124722054735aaa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Security for py-simple-sshd 0.1.9

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.

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