# 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](https://github.com/DPSoftware-Foundation/PyserSSH/releases/download/Legacy/PyserSSH10.py) (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](https://github.com/damp11113/damp11113-library)
## Some small PyserSSH history
PyserSSH version [1.0](https://github.com/DPSoftware-Foundation/PyserSSH/releases/download/Legacy/PyserSSH10.py) (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](https://damp11113.xyz/PyserSSHDocs/history.html)
# Install
Install from pypi
```bash
pip install PyserSSH
```
Install with [openRemoDesk](https://github.com/DPSoftware-Foundation/openRemoDesk) protocol
```bash
pip install PyserSSH[RemoDesk]
```
Install from Github
```bash
pip install git+https://github.com/damp11113/PyserSSH.git
```
Install from DPCloudev Git
```bash
pip install git+https://git.damp11113.xyz/DPSoftware-Foundation/PyserSSH.git
```
# Quick Example
This Server use port **2222** for default port
```py
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/damp11113/PyserSSH",
"name": "PyserSSH",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "SSH server",
"author": "DPSoftware Foundation",
"author_email": "contact@damp11113.xyz",
"download_url": "https://files.pythonhosted.org/packages/61/54/b908abcbaea8d47023c9430c83f707e6439a9dd53f9aa020402eb020b719/pyserssh-5.0.tar.gz",
"platform": null,
"description": "# What is PyserSSH\r\n\r\nPyserSSH 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.\r\n\r\nThe 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.\r\n\r\n## Some smail PyserSSH history\r\nPyserSSH version [1.0](https://github.com/DPSoftware-Foundation/PyserSSH/releases/download/Legacy/PyserSSH10.py) (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.\r\n\r\nThis project is part from [damp11113-library](https://github.com/damp11113/damp11113-library)\r\n\r\n## Some small PyserSSH history\r\nPyserSSH version [1.0](https://github.com/DPSoftware-Foundation/PyserSSH/releases/download/Legacy/PyserSSH10.py) (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.\r\n\r\nread full history from [docs](https://damp11113.xyz/PyserSSHDocs/history.html)\r\n\r\n# Install\r\nInstall from pypi\r\n```bash\r\npip install PyserSSH\r\n```\r\nInstall with [openRemoDesk](https://github.com/DPSoftware-Foundation/openRemoDesk) protocol\r\n```bash\r\npip install PyserSSH[RemoDesk]\r\n```\r\nInstall from Github\r\n```bash\r\npip install git+https://github.com/damp11113/PyserSSH.git\r\n```\r\nInstall from DPCloudev Git\r\n```bash\r\npip install git+https://git.damp11113.xyz/DPSoftware-Foundation/PyserSSH.git\r\n```\r\n\r\n# Quick Example\r\nThis Server use port **2222** for default port\r\n```py\r\nfrom PyserSSH import Server, Send, AccountManager\r\n\r\nuseraccount = AccountManager(anyuser=True)\r\nssh = Server(useraccount)\r\n\r\n@ssh.on_user(\"command\")\r\ndef command(client, command: str):\r\n if command == \"hello\":\r\n Send(client, \"world!\")\r\n \r\nssh.run(\"your private key file\")\r\n```\r\nThis example you can connect with `ssh admin@localhost -p 2222` and press enter on login\r\nIf you input `hello` the response is `world`\r\n\r\n# Demo\r\n> [!WARNING] \r\n> 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.\r\n\r\nhttps://github.com/damp11113/PyserSSH/assets/64675096/49bef3e2-3b15-4b64-b88e-3ca84a955de7\r\n\r\nI 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.\r\nwhy 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 \"\r\nGitGuardian 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.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "python scriptable ssh server library. based on Paramiko",
"version": "5.0",
"project_urls": {
"Homepage": "https://github.com/damp11113/PyserSSH"
},
"split_keywords": [
"ssh",
"server"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6154b908abcbaea8d47023c9430c83f707e6439a9dd53f9aa020402eb020b719",
"md5": "639a15189e5d0ea92d16a1d11624f31b",
"sha256": "20a46787e4183dd3ddb06cac8d95df07619ad6c1fe5e3dd9f274d5052ee9a011"
},
"downloads": -1,
"filename": "pyserssh-5.0.tar.gz",
"has_sig": false,
"md5_digest": "639a15189e5d0ea92d16a1d11624f31b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 31555,
"upload_time": "2024-09-03T13:32:08",
"upload_time_iso_8601": "2024-09-03T13:32:08.470930Z",
"url": "https://files.pythonhosted.org/packages/61/54/b908abcbaea8d47023c9430c83f707e6439a9dd53f9aa020402eb020b719/pyserssh-5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-03 13:32:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "damp11113",
"github_project": "PyserSSH",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyserssh"
}