Skip to content

Commit b6455ce

Browse files
committed
Update 5.0
New main features - ServerManager - RemoDesk protocol support - New client system - Supported auth with none, password and public key - Support remote monitor for mobaxterm user (beta) - SFTP can set specific folder for user - Support exec_request New function - Send_karaoke_effect - ShowCursor - SendBell - NewSend for advance sending like print() - Flag_TH for about - wait_inputmouse for mouse input Fixing - (only python) fixing can't print color without damp11113 library or print color library only in windows on python console - Fixing sometime can't connect SFTP and more
1 parent f33be3b commit b6455ce

30 files changed

Lines changed: 2443 additions & 713 deletions

README.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,57 @@
11
# What is PyserSSH
22

3-
PyserSSH is a library for remote control your code with ssh client. The aim is to provide a scriptable SSH server which can be made to behave like any SSH-enabled device.
3+
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.
4+
5+
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.
46

57
This project is part from [damp11113-library](https://github.com/damp11113/damp11113-library)
68

7-
This Server use port **2222** for default port
9+
## Some small PyserSSH history
10+
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.
811

9-
> [!WARNING]
10-
> 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.
12+
read full history from [docs](https://damp11113.xyz/PyserSSHDocs/history.html)
1113

1214
# Install
1315
Install from pypi
1416
```bash
1517
pip install PyserSSH
1618
```
17-
Install from github
19+
Install with [openRemoDesk](https://github.com/DPSoftware-Foundation/openRemoDesk) protocol
20+
```bash
21+
pip install PyserSSH[RemoDesk]
22+
```
23+
Install from Github
1824
```bash
1925
pip install git+https://github.com/damp11113/PyserSSH.git
2026
```
27+
Install from DPCloudev Git
28+
```bash
29+
pip install git+https://git.damp11113.xyz/DPSoftware-Foundation/PyserSSH.git
30+
```
2131

2232
# Quick Example
33+
This Server use port **2222** for default port
2334
```py
24-
import os
25-
2635
from PyserSSH import Server, Send, AccountManager
2736

28-
useraccount = AccountManager()
29-
useraccount.add_account("admin", "") # create user without password
30-
37+
useraccount = AccountManager(anyuser=True)
3138
ssh = Server(useraccount)
3239

3340
@ssh.on_user("command")
3441
def command(client, command: str):
3542
if command == "hello":
3643
Send(client, "world!")
3744

38-
ssh.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'private_key.pem'))
45+
ssh.run("your private key file")
3946
```
4047
This example you can connect with `ssh admin@localhost -p 2222` and press enter on login
4148
If you input `hello` the response is `world`
4249

4350
# Demo
44-
https://github.com/damp11113/PyserSSH/assets/64675096/49bef3e2-3b15-4b64-b88e-3ca84a955de7
51+
> [!WARNING]
52+
> 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.
4553
46-
For run this demo you can use this command
47-
```
48-
$ python -m PyserSSH
49-
```
50-
then
51-
```
52-
Do you want to run demo? (y/n): y
53-
```
54-
But if no [damp11113-library](https://github.com/damp11113/damp11113-library)
55-
```
56-
No 'damp11113-library'
57-
This demo is require 'damp11113-library' for run
58-
```
59-
you need to install [damp11113-library](https://github.com/damp11113/damp11113-library) for run this demo by choose `y` or `yes` in lowercase or uppercase
60-
```
61-
Do you want to install 'damp11113-library'? (y/n): y
62-
```
63-
For exit demo you can use `ctrl+c` or use `shutdown now` in PyserSSH shell **(not in real terminal)**
54+
https://github.com/damp11113/PyserSSH/assets/64675096/49bef3e2-3b15-4b64-b88e-3ca84a955de7
6455

6556
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.
6657
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 "

demo/Save Your Tears lyrics.srt

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
0
2+
00:00:00,000 --> 00:00:09,200
3+
(Intro)
4+
5+
1
6+
00:00:09,200 --> 00:00:13,100
7+
I saw you dancing in a crowded room
8+
9+
2
10+
00:00:13,200 --> 00:00:17,200
11+
You look so happy when
12+
I'm not with you
13+
14+
3
15+
00:00:17,300 --> 00:00:21,300
16+
But then you saw me, caught
17+
you by surprise
18+
19+
4
20+
00:00:21,400 --> 00:00:26,200
21+
A single teardrop falling
22+
from your eye
23+
24+
5
25+
00:00:26,300 --> 00:00:31,400
26+
I don't know why I run away
27+
28+
6
29+
00:00:34,400 --> 00:00:40,900
30+
I'll make you cry when I run away
31+
32+
7
33+
00:00:41,700 --> 00:00:45,950
34+
You could've asked me why
35+
I broke your heart
36+
37+
8
38+
00:00:46,000 --> 00:00:49,800
39+
You could've told me
40+
that you fell apart
41+
42+
9
43+
00:00:49,900 --> 00:00:53,700
44+
But you walked past me
45+
like I wasn't there
46+
47+
10
48+
00:00:53,800 --> 00:00:58,450
49+
And just pretended like
50+
you didn't care
51+
52+
11
53+
00:00:58,500 --> 00:01:03,000
54+
I don't know why I run away
55+
56+
12
57+
00:01:06,400 --> 00:01:11,300
58+
I'll make you cry when I run away
59+
60+
13
61+
00:01:14,700 --> 00:01:18,600
62+
Take me back 'cause I wanna stay
63+
64+
14
65+
00:01:18,700 --> 00:01:21,600
66+
Save your tears for another
67+
68+
15
69+
00:01:21,700 --> 00:01:28,900
70+
Save your tears for another day
71+
72+
16
73+
00:01:29,800 --> 00:01:34,700
74+
Save your tears for another day
75+
76+
17
77+
00:01:37,000 --> 00:01:42,900
78+
So, I made you think that
79+
I would always stay
80+
81+
18
82+
00:01:43,000 --> 00:01:46,600
83+
I said some things that
84+
I should never say
85+
86+
19
87+
00:01:46,700 --> 00:01:50,600
88+
Yeah, I broke your heart like
89+
someone did to mine
90+
91+
20
92+
00:01:50,700 --> 00:01:55,500
93+
And now you won't love
94+
me for a second time
95+
96+
21
97+
00:01:55,600 --> 00:02:00,400
98+
I don't know why I run away, oh, girl
99+
100+
22
101+
00:02:03,300 --> 00:02:08,800
102+
Said I make you cry when I run away
103+
104+
23
105+
00:02:11,500 --> 00:02:15,600
106+
Girl, take me back 'cause I wanna stay
107+
108+
24
109+
00:02:15,700 --> 00:02:19,200
110+
Save your tears for another
111+
112+
25
113+
00:02:19,300 --> 00:02:23,600
114+
I realize that I'm much too late
115+
116+
26
117+
00:02:23,700 --> 00:02:26,800
118+
And you deserve someone better
119+
120+
27
121+
00:02:26,900 --> 00:02:32,000
122+
Save your tears for another
123+
day (Ooh, yeah)
124+
125+
28
126+
00:02:34,900 --> 00:02:40,900
127+
Save your tears for another day (Yeah)
128+
129+
29
130+
00:02:46,100 --> 00:02:52,300
131+
I don't know why I run away
132+
133+
30
134+
00:02:52,700 --> 00:02:57,400
135+
I'll make you cry when I run away
136+
137+
31
138+
00:02:59,400 --> 00:03:06,650
139+
Save your tears for another
140+
day, ooh, girl (Ah)
141+
142+
32
143+
00:03:06,700 --> 00:03:13,600
144+
I said save your tears
145+
for another day (Ah)
146+
147+
33
148+
00:03:15,700 --> 00:03:23,200
149+
Save your tears for another day (Ah)
150+
151+
34
152+
00:03:23,700 --> 00:03:33,300
153+
Save your tears for another day (Ah)
154+
155+
35
156+
00:03:34,300 --> 00:03:43,300
157+
by DPSoftware Foundation

0 commit comments

Comments
 (0)