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.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sshserve-0.1.0a3.tar.gz.
File metadata
- Download URL: sshserve-0.1.0a3.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
124860658522ed70713f8fe382426e81deca55108a1d3c14f03f6020b8a0de3b
|
|
| MD5 |
c0009bc194535a2255645e0e479797a6
|
|
| BLAKE2b-256 |
a13ed37481eb11d256517a898772fa5e9fea49f0940bfd045d7bf7f52dd57fd9
|
File details
Details for the file sshserve-0.1.0a3-py2.py3-none-any.whl.
File metadata
- Download URL: sshserve-0.1.0a3-py2.py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba5ff88eafece1681e06f2b4029014cfe8bf30e29d3e3357932ee6c9119c09a
|
|
| MD5 |
d0a6be3c4db9b057b8b6ffcaf8aa6961
|
|
| BLAKE2b-256 |
704c7ee52064eaf7267c59de6d3da68fde769af8f2015cd6814292b8c678c65e
|