Python implementation of SSH No Ports daemon
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sshnpd-0.4.14.tar.gz
.
File metadata
- Download URL: sshnpd-0.4.14.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 452d80aaea73bbe8a5fd5ce07427bbc0b126d4965cd177d78087e44edcb79450 |
|
MD5 | 8fc5e32ef0df735adb44c71107612f64 |
|
BLAKE2b-256 | fedfa3e5ace7843862ae5bf00326d1bd394294e3bb175c95f946eed2d64d0d34 |
File details
Details for the file sshnpd-0.4.14-py3-none-any.whl
.
File metadata
- Download URL: sshnpd-0.4.14-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.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed246a20486bd15589e49690dd64e9ab7bc0348ec48474d5273535ede341b46c |
|
MD5 | f5d392d66b47c1da9ebfbdd041778a24 |
|
BLAKE2b-256 | 33adc86dbe8273c61c4ff702d860faa911a9a3a3910c5fd3ebc2b3707b578deb |