Skip to main content

ssh from config with arrow select support

Project description

sshg

先说为什么起这个名字呢? 因为我之前起的几个名字sshx, sshs 都被别人捷足先登了,而且项目写的还不错。可他们的项目又不能满足我快速选择要连接的设备和远程配置的需求,所以我就只起sshg这个名字了

codecov PyPI version

支持的功能

  • 支持将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

LICENSE

MIT

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.1.5.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

sshg-0.1.5-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file sshg-0.1.5.tar.gz.

File metadata

  • Download URL: sshg-0.1.5.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for sshg-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f72df9e5f566467b0635ecc6dea7285834094542c9ba3702d5d5859d77a0595b
MD5 cb6735539ec85b988a4378d3183f9f24
BLAKE2b-256 23fe0fc446ff56d3380739a0b6507c19cfc302b232e1cc9978054277f74d0737

See more details on using hashes here.

File details

Details for the file sshg-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: sshg-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for sshg-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8010d0baf2f3aeb11c82b210be846ff1fc13e0174454b65f88b62e4cfeecf73d
MD5 0fcb48337bdd7757430b9eb4a096bc09
BLAKE2b-256 e04cde353092cee47560f761526474da266a3a6468f29ad85abec3297c64c838

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page