Skip to main content

python scriptable ssh server library. based on Paramiko

Project description

What is PyserSSH

PyserSSH is a free and open-source Python library designed to facilitate the creation of customizable SSH terminal servers. Initially developed for research purposes to address the lack of suitable SSH server libraries in Python, PyserSSH provides a flexible and user-friendly solution for implementing SSH servers, making it easier for developers to handle user interactions and command processing.

The project was started by a solo developer to create a more accessible and flexible tool for managing SSH connections and commands. It offers a simplified API compared to other libraries, such as Paramiko, SSHim, and Twisted, which are either outdated or complex for new users.

Some smail PyserSSH history

PyserSSH version 1.0 (real filename is "test277.py") was created in 2023/9/3 for experimental purposes only. Because I couldn't find the best ssh server library for python and I started this project only for research. But I have time to develop this research into a real library for use. In software or server.

This project is part from damp11113-library

Some small PyserSSH history

PyserSSH version 1.0 (real filename is "test277.py") was created in 2023/9/3 for experimental purposes only. Because I couldn't find the best ssh server library for python and I started this project only for research. But I have time to develop this research into a real library for use. In software or server.

read full history from docs

Install

Install from pypi

pip install PyserSSH

Install with openRemoDesk protocol

pip install PyserSSH[RemoDesk]

Install from Github

pip install git+https://github.com/damp11113/PyserSSH.git

Install from DPCloudev Git

pip install git+https://git.damp11113.xyz/DPSoftware-Foundation/PyserSSH.git

Quick Example

This Server use port 2222 for default port

from PyserSSH import Server, Send, AccountManager

useraccount = AccountManager(anyuser=True)
ssh = Server(useraccount)

@ssh.on_user("command")
def command(client, command: str):
    if command == "hello":
        Send(client, "world!")
        
ssh.run("your private key file")

This example you can connect with ssh admin@localhost -p 2222 and press enter on login If you input hello the response is world

Demo

[!WARNING]
For use in product please generate new private key! If you still use this demo private key maybe your product getting hacked! up to 90%. Please don't use this demo private key for real product.

https://github.com/damp11113/PyserSSH/assets/64675096/49bef3e2-3b15-4b64-b88e-3ca84a955de7

I intend to leaked private key because that key i generated new. I recommend to generate new key if you want to use on your host because that key is for demo only. why i talk about this? because when i push private key into this repo in next 5 min++ i getting new email from GitGuardian. in that email say " GitGuardian has detected the following RSA Private Key exposed within your GitHub account" i dont knows what is GitGuardian and i not install this app into my account.

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

pyserssh-5.0.tar.gz (31.6 kB view details)

Uploaded Source

File details

Details for the file pyserssh-5.0.tar.gz.

File metadata

  • Download URL: pyserssh-5.0.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyserssh-5.0.tar.gz
Algorithm Hash digest
SHA256 20a46787e4183dd3ddb06cac8d95df07619ad6c1fe5e3dd9f274d5052ee9a011
MD5 639a15189e5d0ea92d16a1d11624f31b
BLAKE2b-256 6154b908abcbaea8d47023c9430c83f707e6439a9dd53f9aa020402eb020b719

See more details on using hashes here.

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