ssh from config with arrow select support
Project description
sshg
先说为什么起这个名字呢? 因为我之前起的几个名字sshx, sshs 都被别人捷足先登了,而且项目写的还不错。可他们的项目又不能满足我快速选择要连接的设备和远程配置的需求,所以我就只起sshg这个名字了
支持的功能
- 支持将ip,user,password写入到配置文件中,并快速的键盘选择上下选择功能(VIM的hj也支持)
- 支持ssh跳板机的功能
- 远程配置的功能
安装
pip3 install sshg
使用
创建配置文件 ~/.sshg.yml
文件内容例子
- name: inner-server
user: appuser
host: 192.168.8.35
port: 22
password: 123456 # login password
via:
user: via-server
host: 10.0.0.38
port: 2222
- name: dev server fully configured
user: appuser
host: 192.168.1.1
keypath: ~/.ssh/id_rsa
password: abcdefghijklmn # passphrase
callback-shells:
- { delay: 1, cmd: "uptime" }
- { cmd: "echo 1" }
- name: dev group
port: 22 # children will inherit all the configs as default
children:
- user: pc01
host: 192.168.3.1
- user: pc02
host: 192.168.3.2
- host: 192.168.3.3 # leave user empty will set to current user
$ sshg
Use the arrow keys to navigate (support vim style): ↓ ↑
✨ Select host
➤ inner-server appuser@192.168.8.35
dev server fully configured appuser@192.168.1.1
dev group
# specify config file
$ sshg --conf ~/.sshg.yml
开发者文档
# 没安装就装一下,项目依赖poetry发布
# pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
poetry publish --build
# 进入到项目的虚拟环境
poetry shell
Refs
- https://poetry.eustace.io/docs/
- https://pypi.org/project/poetry-dynamic-versioning/
- https://github.com/yinheli/sshw UI风格基本都是参考这个项目
- https://github.com/WqyJh/sshx 本来用这个名字的,发现跟它重复了
- https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ 如何使用Github Actions发布
LICENSE
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
sshg-0.2.0.tar.gz
(6.9 kB
view details)
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
sshg-0.2.0-py3-none-any.whl
(7.6 kB
view details)
File details
Details for the file sshg-0.2.0.tar.gz.
File metadata
- Download URL: sshg-0.2.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35f602851e6602e756b28431180b22651c8498aa14421355135b31037cd14fa2
|
|
| MD5 |
609af036f08ed3c9a1cf4272f78706b1
|
|
| BLAKE2b-256 |
e5e2a75718c0f6c1298f67365b125d039731ab5617f457b2afd947007e8aee7d
|
File details
Details for the file sshg-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sshg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c61db8d5cec3f55d6e540cb78ef28845a8583c7df90d34b7175b99755f8281d
|
|
| MD5 |
ee18f63addfaa4fe77669d6962bb16ec
|
|
| BLAKE2b-256 |
f0c72266f16fd4731ef8da5fa370d7d75520ae0ca371da731a42df781270b5d7
|