ssh-handler 1.2.0__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/PKG-INFO +49 -6
  2. ssh_handler-1.2.0/ssh_handler.egg-info/PKG-INFO → ssh_handler-1.3.0/README.md +523 -506
  3. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/pyproject.toml +1 -1
  4. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/__init__.py +1 -1
  5. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/core.py +35 -0
  6. ssh_handler-1.2.0/README.md → ssh_handler-1.3.0/ssh_handler.egg-info/PKG-INFO +549 -480
  7. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/LICENSE +0 -0
  8. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/setup.cfg +0 -0
  9. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/__main__.py +0 -0
  10. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/cli.py +0 -0
  11. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/config.py +0 -0
  12. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/credentials.py +0 -0
  13. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/exceptions.py +0 -0
  14. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/ftp.py +0 -0
  15. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/openssh/OpenSSH-ARM64.zip +0 -0
  16. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/openssh/OpenSSH-Win32.zip +0 -0
  17. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/openssh/OpenSSH-Win64.zip +0 -0
  18. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/pool.py +0 -0
  19. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/pyqt_worker.py +0 -0
  20. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/results.py +0 -0
  21. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/serial_handler.py +0 -0
  22. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/setup_openssh_server.ps1 +0 -0
  23. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler/winrm_bootstrap.py +0 -0
  24. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler.egg-info/SOURCES.txt +0 -0
  25. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler.egg-info/dependency_links.txt +0 -0
  26. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler.egg-info/entry_points.txt +0 -0
  27. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler.egg-info/requires.txt +0 -0
  28. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/ssh_handler.egg-info/top_level.txt +0 -0
  29. {ssh_handler-1.2.0 → ssh_handler-1.3.0}/tests/test_offline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-handler
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Extensive SSH/SFTP/SCP/FTP handler built on Paramiko, for test automation, CLIs and PyQt5 tools.
5
5
  Author: ssh-handler contributors
6
6
  License-Expression: MIT
@@ -295,11 +295,54 @@ To stop a stream from another thread (e.g. a GUI Stop button), pass a
295
295
  Same streaming + match + save model for device serial consoles (included by
296
296
  default — no extra install).
297
297
 
298
- > **Important where the COM port physically is.** `pyserial` opens a *local*
299
- > port, so this runs on the machine the device is **plugged into**. If the device
300
- > is on your laptop, run it on your laptop. If it's on the remote/RDP machine,
301
- > either run the script there, or — on Linux targets — stream the device file
302
- > over SSH instead: `ssh.stream("cat /dev/ttyUSB0", match=..., save_to=...)`.
298
+ ### Local serial (device plugged into the machine running the code)
299
+ ```python
300
+ from ssh_handler import SerialHandler, list_serial_ports
301
+ print(list_serial_ports())
302
+ with SerialHandler("COM5", baudrate=115200, quiet=True) as ser:
303
+ ser.write_line("version")
304
+ ser.stream(on_line=print, match=r"login:", stop_on_match=True, save_to="console.log")
305
+ ```
306
+
307
+ ### Serial via RDP / jump host (device on the remote target)
308
+ `pyserial` only opens a *local* port, so when the serial cable is on the remote
309
+ box (reached through your RDP jump), stream it **over SSH** with `serial_stream()`
310
+ — same live match + save, routed through the jump:
311
+
312
+ ```python
313
+ rdp_box = SSHConfig(host="10.232.9.22", domain="CORP", username="myuser", password="pw")
314
+ target = SSHConfig(host="10.120.1.91", username="root", password="pw",
315
+ jump_host=rdp_box, host_key_policy="ignore")
316
+
317
+ with SSHHandler(target, quiet=True) as ssh:
318
+ ssh.serial_write("/dev/ttyUSB0", "version") # write to the device
319
+ ssh.serial_stream("/dev/ttyUSB0", baudrate=115200, # read it live
320
+ on_line=print, match=r"login:|ERROR",
321
+ save_to="device_console.log", timeout=120)
322
+ ```
323
+
324
+ `serial_stream()` sets the line speed with `stty` then streams the device — for
325
+ **Linux targets**. (Windows COM ports on the remote side need a remote helper;
326
+ ask if you need that.)
327
+
328
+ ## File transfer (SFTP / SCP / FTP) via RDP
329
+
330
+ **SFTP and SCP already work through the jump host** — no special setup. Once you
331
+ pass `jump_host=`, every transfer runs over that tunnel (laptop → RDP → target):
332
+
333
+ ```python
334
+ with SSHHandler(target, quiet=True) as ssh: # target has jump_host=rdp_box
335
+ ssh.push("firmware.bin", "/tmp/firmware.bin") # SFTP, through the jump
336
+ ssh.pull("/var/log/messages", "messages.log") # SFTP, through the jump
337
+ ssh.scp_push("img.tar", "/tmp/img.tar") # SCP, through the jump
338
+ print(ssh.read_text("/etc/os-release"))
339
+ ```
340
+
341
+ **FTP via RDP:** FTP is a separate protocol (its data channel can't ride an SSH
342
+ tunnel cleanly), so prefer **SFTP through the jump** as shown above — it does the
343
+ same job better and is already routed via RDP. If you specifically need a real
344
+ FTP *server* on the target, run `FTPHandler` on the RDP machine itself (where it
345
+ can reach that server directly).
303
346
 
304
347
  ```python
305
348
  from ssh_handler import SerialHandler, list_serial_ports