Skip to main content

ssh client config manager

Project description

SSH Config

PyPI version Build Status

SSH client config file manager

What is ssh_config?

https://linux.die.net/man/5/ssh_config

Why

I don't remember all the servers I am managing. Also all servers require all different configurations to connect to it. I know ~.ssh/config can handle this kind of issue. I want it to handle this file easier.

Yes, I am not sure this is easier way to handle it. but I am trying.

Requirements

After 0.0.15, Python27 is not supported.

Python 3.6 or higher

Installation

pip3 install ssh-config

Usage

Usage: ssh-config [OPTIONS] COMMAND [ARGS]...

Options:
  -f, --path TEXT       [default: /Users/jonghak.choi/.ssh/config]
  --debug / --no-debug
  --version             Show the version and exit.
  --help                Show this message and exit.

Commands:
  add         Add SSH Config into config file
  attributes  Print possible attributes for Host
  gen         Generate the ssh config
  get         Get ssh config with name
  ls          Enumerate the configs
  remove
  rename
  ssh         Interative shell for Host
  update      Update the ssh Host config Attribute key=value format

Use-cases

List hosts

$ ssh-config ls
server1
server_cmd_1
server_cmd_2
server_cmd_3

$ ssh-config ls -l
server1			10.0.2.10
server_cmd_1	10.0.1.11
server_cmd_2	10.0.1.12
server_cmd_3	10.0.1.13
Add host
$ ssh-config add "server_cmd_4" HostName=203.0.113.77 IdentityFile="~/.ssh/cmd_id_rsa"
Update host
$ ssh-config update "server_cmd_3" IdentityFile="~/.ssh/cmd_id_rsa"
Remove host
$ ssh-config remove "server_3"

Using pattern to get list or update exist hosts

add ssh key to multiple servers

ssh-config ls | xargs -I{} ssh-copy-id -i ~/.ssh/id_rsa {}

Export ssh-config to ansible inventory ini format.

https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html?extIdCarryOver=true&sc_cid=701f2000001OH7EAAW#inventory-script-conventions

ssh-config inventory --list|--host <hostname>

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

ssh_config-0.1.2.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

ssh_config-0.1.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file ssh_config-0.1.2.tar.gz.

File metadata

  • Download URL: ssh_config-0.1.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ssh_config-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b91110727ad14fa7d88488dd2389e33d3f21f2be8c415f338a0fda12f9784c5c
MD5 04d1bda5cc8953950293c16826df5001
BLAKE2b-256 58e0395e16f4a15f330d7e35bc59dcce86a2eb755eaf2576a6f64f1fd34d2aec

See more details on using hashes here.

Provenance

File details

Details for the file ssh_config-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ssh_config-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ssh_config-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8918caa7894b9c32ea0b450c24b6091fc8036a107edf3afe7397695c4be995ba
MD5 703dc8aa5759761bcd4248b036fbddd4
BLAKE2b-256 edc891120ef4d53cdf9f7217b1b2c287909d02760c028d093d6a5fce95022770

See more details on using hashes here.

Provenance

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