Skip to main content

A small, production-oriented SSH daemon implemented with Paramiko.

Project description

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.

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.
  • 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.

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

py_simple_sshd-0.1.8.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

py_simple_sshd-0.1.8-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file py_simple_sshd-0.1.8.tar.gz.

File metadata

  • Download URL: py_simple_sshd-0.1.8.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for py_simple_sshd-0.1.8.tar.gz
Algorithm Hash digest
SHA256 e785bc5fbe308cadc6e41cd33805595d50b1f5e9684da5f0b6b7999f6dd4c51a
MD5 93a39f6cda8306344c2c991d2afe3c45
BLAKE2b-256 63c6432f58a0b9d40cbb26f238204488efb5a640e1b7c5212c94683f2ec24a20

See more details on using hashes here.

File details

Details for the file py_simple_sshd-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: py_simple_sshd-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for py_simple_sshd-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c7e061ed3f64b4ac2bcefd107752818a83151611e3feab10d0b4b1ea3b85cc47
MD5 7fd6dff8d2634eec75387c8910d7d071
BLAKE2b-256 79865c9dfa8d4f8c86c5d2bb7682462d885b8f192dab8cbcd8bd602dde7c1236

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