Skip to main content

Python implementation of SSH No Ports daemon

Project description

The Atsign Foundation

GitHub License PyPI version SLSA 3

SSHNPD Python (beta)

SSH No Ports provides a way to ssh to a remote linux host/device without that device or the client having any open ports (not even 22) on external interfaces. All network connectivity is outbound and there is no need to know the IP address the device has been given. As long as the device and client has an IP address (public or private 1918), DNS and Internet access, you will be able to connect to it.

This version is SSHNP Daemon written in Python, it is still in its beta stage of developement.

Prerequisites

SSHNPD Python requires the following:

  • Python 3.10 or later on a system where the following packages containing native code are available[1]:
    • bcrypt
    • cffi
    • charset-normalizer
    • cryptography
  • Two atSigns, one for the client and one for the device
    • The device atSign keys file should be placed in ~/.atsign/keys
  • An sshd bound to (at least) localhost
    • Port 22 is the assumed default, but can be overridden

[1] A common problem with installation is that native packages for a given architecture or libc aren't available. Pip will then download the source and try to compile that, which usually fails because the required toolchain isn't present.

Installation

This package can be installed from PyPI with:

pip install sshnpd

Though some systems will need pip3 rather than pip:

pip3 install sshnpd

Python virtual environments (venv)

Recent Linux distributions such as Debian 12 and derivatives (including Ubuntu 24.04 and Rapberry Pi OS 'Bookworm') no longer allow the installation of packages from PyPI into the system Python. It's therefore necessary to use a virtual environment (venv).

First ensure that pip and the venv module are available:

sudo apt install -y python3-pip python3-venv

Then create and activate a venv:

python3 -m venv sshnpd
. sshnpd/bin/activate

The daemon can then be installed as before:

pip install sshnpd

Just remember to activate the venv first whenever using the daemon.

Installing from source

Alternatively clone this repo and from the repo root:

cd packages/python/sshnpd
pip install -r requirements.txt
pip install .

Running the daemon

sshnpd -m @{clientAtsign} -a @{deviceAtsign} -d {deviceName} -u

e.g.

sshnpd -m @zaphod -a @heartofgold -d eddie -u

Connecting to the daemon

The Python version of SSHNPD presently implements v4 functionality, so it's a little behind the Dart implementation, and the latest client needs some flags to ensure compatibility:

sshnp -f @{clientAtsign} -t @{deviceAtsign} -d {deviceName} \
-r @{rvPoint} -u {user} --no-ad --no-et

e.g.

sshnp -f @zaphod -t @heartofgold -d eddie -r @rv_am -u ubuntu --no-ad --no-et

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

sshnpd-0.4.15.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

sshnpd-0.4.15-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file sshnpd-0.4.15.tar.gz.

File metadata

  • Download URL: sshnpd-0.4.15.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for sshnpd-0.4.15.tar.gz
Algorithm Hash digest
SHA256 dea803586720bae1730cf12017d3c3a216468cd012dc726d3c1fc657b81cfc3c
MD5 9f63ae0c647101691841b206f71490da
BLAKE2b-256 785f6c06341e508c9066a22ea52ae26f1c777ef106e003c66da3cad3b5d09785

See more details on using hashes here.

Provenance

The following attestation bundles were made for sshnpd-0.4.15.tar.gz:

Publisher: python-sshnpd-build-publish.yml on atsign-foundation/noports

Attestations:

File details

Details for the file sshnpd-0.4.15-py3-none-any.whl.

File metadata

  • Download URL: sshnpd-0.4.15-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for sshnpd-0.4.15-py3-none-any.whl
Algorithm Hash digest
SHA256 189798da61de82833d2e829484151fc36cbae24f4d856fefdc250c1de7085ab4
MD5 7d65768f1429fbb2970ae3f7b0c2a536
BLAKE2b-256 f859c486fccd3ae5557f5f6f2f412484f65410ae22b9e961ee084b75fbcde672

See more details on using hashes here.

Provenance

The following attestation bundles were made for sshnpd-0.4.15-py3-none-any.whl:

Publisher: python-sshnpd-build-publish.yml on atsign-foundation/noports

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page