This release is a pre-release and may not be stable for production use.
Userland non-daemon SSH server that inherits the current user privileges and serves whatever that user can access, with shell, exec, SFTP, and TCP forwarding on POSIX systems.
Novelty
This project is intentionally positioned between telnetd-style ad hoc sharing and a full system sshd deployment.
What is novel here is the combination of:
- userland operation with no system daemon setup
- current-user privilege inheritance instead of a separate service account model
- quick startup for temporary ad hoc sharing
- one small foreground server process
- shell, exec, SFTP, local forwarding, and reverse forwarding together
- real SSH transport and host keys instead of telnet
In other words, this is not trying to replace a hardened multi-user OpenSSH installation. It is trying to provide a quick, dirty, but still encrypted SSH sharing tool for scenarios where telnetd would historically have been used.
Installation
pip install sshshare
Usage
Quick start (no auth, auto host key)
If you have ~/.ssh/id_ed25519 or ~/.ssh/id_rsa, just run:
sshserve
This auto-discovers your host key and accepts any authentication.
With explicit host key
ssh-keygen -t ed25519 -f host_ed25519
sshserve --host-ed25519-key host_ed25519
With authentication
ssh-keygen -t ed25519 -f host_ed25519
sshserve --username alice --password secret --host 127.0.0.1 --port 2222 --host-ed25519-key host_ed25519
Connect from another terminal with SFTP:
sftp -P 2222 alice@127.0.0.1
Open an interactive shell over SSH:
ssh -p 2222 alice@127.0.0.1
Run a remote command:
ssh -p 2222 alice@127.0.0.1 'pwd && ls'
Use local port forwarding through the server:
ssh -L 8080:127.0.0.1:80 -p 2222 alice@127.0.0.1
Use remote port forwarding through the server:
ssh -R 9090:127.0.0.1:90 -p 2222 alice@127.0.0.1
Use an RSA host key or a passphrase-protected host key:
ssh-keygen -t rsa -f host_rsa
sshserve --host-rsa-key host_rsa --host-key-passphrase your-passphrase
Notes:
- The SFTP root is the real filesystem root
/. - Accessible files and directories are whatever the current OS user running
sshservecan access. - Shell sessions and exec commands inherit the current user privileges.
- Shell sessions and exec commands start in the current working directory of the
sshserveprocess. --usernameand--passwordare optional. When omitted, any authentication (none, password, publickey) is accepted.- Host key is auto-discovered from
~/.ssh/id_ed25519or~/.ssh/id_rsa. Override with--host-ed25519-keyor--host-rsa-key. - PTY shell access is supported on POSIX systems.
- Direct TCP forwarding and reverse TCP forwarding are supported.
- This implementation is POSIX-only because process launching uses
ctypes-unicode-proclaunchand PTY handling uses POSIX APIs.
Contributing
Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.
License
This project is licensed under the MIT License.
Release files for sshserve 0.1.0a3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sshserve-0.1.0a3.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sshserve-0.1.0a3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 25.2 kB
Release files / sshserve-0.1.0a3.tar.gz
| Download URL | sshserve-0.1.0a3.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
124860658522ed70713f8fe382426e81deca55108a1d3c14f03f6020b8a0de3b
|
|
BLAKE2b-256 checksum How to use checksums |
a13ed37481eb11d256517a898772fa5e9fea49f0940bfd045d7bf7f52dd57fd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / sshserve-0.1.0a3-py2.py3-none-any.whl
| Download URL | sshserve-0.1.0a3-py2.py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9ba5ff88eafece1681e06f2b4029014cfe8bf30e29d3e3357932ee6c9119c09a
|
|
BLAKE2b-256 checksum How to use checksums |
704c7ee52064eaf7267c59de6d3da68fde769af8f2015cd6814292b8c678c65e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|