# sshg
先说为什么起这个名字呢?
因为我之前起的几个名字sshx, sshs 都被别人捷足先登了,而且项目写的还不错。可他们的项目又不能满足我快速选择要连接的设备和远程配置的需求,所以我就只起sshg这个名字了
[![codecov](https://codecov.io/gh/codeskyblue/sshg/branch/master/graph/badge.svg?token=RUS38DVMCR)](https://codecov.io/gh/codeskyblue/sshg)
[![PyPI version](https://badge.fury.io/py/sshg.svg)](https://badge.fury.io/py/sshg)
## 支持的功能
- [x] 支持将ip,user,password写入到配置文件中,并快速的键盘选择上下选择功能(VIM的hj也支持)
- [x] 支持ssh跳板机的功能
- [ ] 远程配置的功能
## 安装
```bash
pip3 install sshg
```
## 使用
创建配置文件 `~/.sshg.yml`
文件内容例子
```yaml
- 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
```
```bash
$ 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
```
## 开发者文档
```bash
# 没安装就装一下,项目依赖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
[MIT](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/codeskyblue/sshg",
"name": "sshg",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "codeskyblue",
"author_email": "codeskyblue@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/23/fe/0fc446ff56d3380739a0b6507c19cfc302b232e1cc9978054277f74d0737/sshg-0.1.5.tar.gz",
"platform": null,
"description": "# sshg\n\u5148\u8bf4\u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\u5462\uff1f\n\u56e0\u4e3a\u6211\u4e4b\u524d\u8d77\u7684\u51e0\u4e2a\u540d\u5b57sshx, sshs \u90fd\u88ab\u522b\u4eba\u6377\u8db3\u5148\u767b\u4e86\uff0c\u800c\u4e14\u9879\u76ee\u5199\u7684\u8fd8\u4e0d\u9519\u3002\u53ef\u4ed6\u4eec\u7684\u9879\u76ee\u53c8\u4e0d\u80fd\u6ee1\u8db3\u6211\u5feb\u901f\u9009\u62e9\u8981\u8fde\u63a5\u7684\u8bbe\u5907\u548c\u8fdc\u7a0b\u914d\u7f6e\u7684\u9700\u6c42\uff0c\u6240\u4ee5\u6211\u5c31\u53ea\u8d77sshg\u8fd9\u4e2a\u540d\u5b57\u4e86\n\n[![codecov](https://codecov.io/gh/codeskyblue/sshg/branch/master/graph/badge.svg?token=RUS38DVMCR)](https://codecov.io/gh/codeskyblue/sshg)\n[![PyPI version](https://badge.fury.io/py/sshg.svg)](https://badge.fury.io/py/sshg)\n\n## \u652f\u6301\u7684\u529f\u80fd\n- [x] \u652f\u6301\u5c06ip,user,password\u5199\u5165\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u5e76\u5feb\u901f\u7684\u952e\u76d8\u9009\u62e9\u4e0a\u4e0b\u9009\u62e9\u529f\u80fd(VIM\u7684hj\u4e5f\u652f\u6301)\n- [x] \u652f\u6301ssh\u8df3\u677f\u673a\u7684\u529f\u80fd\n- [ ] \u8fdc\u7a0b\u914d\u7f6e\u7684\u529f\u80fd\n\n## \u5b89\u88c5\n```bash\npip3 install sshg\n```\n\n## \u4f7f\u7528\n\u521b\u5efa\u914d\u7f6e\u6587\u4ef6 `~/.sshg.yml`\n\n\u6587\u4ef6\u5185\u5bb9\u4f8b\u5b50\n\n```yaml\n- name: inner-server\n user: appuser\n host: 192.168.8.35\n port: 22\n password: 123456 # login password\n via:\n user: via-server\n host: 10.0.0.38\n port: 2222\n- name: dev server fully configured\n user: appuser\n host: 192.168.1.1\n keypath: ~/.ssh/id_rsa\n password: abcdefghijklmn # passphrase\n callback-shells:\n - { delay: 1, cmd: \"uptime\" }\n - { cmd: \"echo 1\" }\n- name: dev group\n port: 22 # children will inherit all the configs as default\n children:\n - user: pc01\n host: 192.168.3.1\n - user: pc02\n host: 192.168.3.2\n - host: 192.168.3.3 # leave user empty will set to current user\n```\n\n```bash\n$ sshg\nUse the arrow keys to navigate (support vim style): \u2193 \u2191 \n\u2728 Select host\n \u27a4 inner-server appuser@192.168.8.35\n dev server fully configured appuser@192.168.1.1\n dev group\n\n# specify config file\n$ sshg --conf ~/.sshg.yml\n```\n\n\n## \u5f00\u53d1\u8005\u6587\u6863\n\n```bash\n# \u6ca1\u5b89\u88c5\u5c31\u88c5\u4e00\u4e0b\uff0c\u9879\u76ee\u4f9d\u8d56poetry\u53d1\u5e03\n# pip install poetry\n\npoetry self add \"poetry-dynamic-versioning[plugin]\"\npoetry publish --build\n\n# \u8fdb\u5165\u5230\u9879\u76ee\u7684\u865a\u62df\u73af\u5883\npoetry shell\n```\n\n\n# Refs\n- https://poetry.eustace.io/docs/\n- https://pypi.org/project/poetry-dynamic-versioning/\n- https://github.com/yinheli/sshw UI\u98ce\u683c\u57fa\u672c\u90fd\u662f\u53c2\u8003\u8fd9\u4e2a\u9879\u76ee\n- https://github.com/WqyJh/sshx \u672c\u6765\u7528\u8fd9\u4e2a\u540d\u5b57\u7684\uff0c\u53d1\u73b0\u8ddf\u5b83\u91cd\u590d\u4e86\n- https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ \u5982\u4f55\u4f7f\u7528Github Actions\u53d1\u5e03\n\n# LICENSE\n[MIT](LICENSE)\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "ssh from config with arrow select support",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/codeskyblue/sshg"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e04cde353092cee47560f761526474da266a3a6468f29ad85abec3297c64c838",
"md5": "0fcb48337bdd7757430b9eb4a096bc09",
"sha256": "8010d0baf2f3aeb11c82b210be846ff1fc13e0174454b65f88b62e4cfeecf73d"
},
"downloads": -1,
"filename": "sshg-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0fcb48337bdd7757430b9eb4a096bc09",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 7022,
"upload_time": "2023-07-13T03:17:30",
"upload_time_iso_8601": "2023-07-13T03:17:30.213032Z",
"url": "https://files.pythonhosted.org/packages/e0/4c/de353092cee47560f761526474da266a3a6468f29ad85abec3297c64c838/sshg-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "23fe0fc446ff56d3380739a0b6507c19cfc302b232e1cc9978054277f74d0737",
"md5": "cb6735539ec85b988a4378d3183f9f24",
"sha256": "f72df9e5f566467b0635ecc6dea7285834094542c9ba3702d5d5859d77a0595b"
},
"downloads": -1,
"filename": "sshg-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "cb6735539ec85b988a4378d3183f9f24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 6418,
"upload_time": "2023-07-13T03:17:31",
"upload_time_iso_8601": "2023-07-13T03:17:31.685917Z",
"url": "https://files.pythonhosted.org/packages/23/fe/0fc446ff56d3380739a0b6507c19cfc302b232e1cc9978054277f74d0737/sshg-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-13 03:17:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "codeskyblue",
"github_project": "sshg",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "sshg"
}