Skip to main content

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 requires all different configuration to connec 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 eaiser way to handle it. but I am trying.

Requirements

Python 2.7, 3.6, 3.7

Installation

$ pip install ssh-config

Usage

ssh-config.

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

    Options:
        -h --help           Show this screen.
        -v --version        Show version.
        -f --config FILE    Specify an ssh client file [default: ~/.ssh/config]

    Commands:
        ls          Show list of Hosts in client file
        add         Add new Host configuration
        update      UPdate Host configuration
        rm          Remove exist Host configuration
        import      Import Hosts from csv file to SSH Client config
        init        Create ~/.ssh/config file
        host        Get Host information
        version     Show version information

Use-cases

List hosts

$ ssh-config ls 
# It shows name and HostName attribute
server1: 203.0.113.76
*: None
server_cmd_1: 203.0.113.76
server_cmd_2: 203.0.113.76
server_cmd_3: 203.0.113.76
Add host
$ ssh-config add "server_cmd_4" HostName=203.0.113.77 IdentityFile="~/.ssh/cmd_id_rsa"
Update host
$ ssh-config add --update -p "server_cmd_3" IdentityFile="~/.ssh/cmd_id_rsa"
Remove host
$ ssh-config rm "server_3" 

Using pattern to get list or update exist hosts

List hosts with pattern
$ ssh-config ls "server_*"
# It shows name and HostName attribute
server_cmd_1: 203.0.113.76
server_cmd_2: 203.0.113.76
server_cmd_3: 203.0.113.76
Update hosts with pattern
$ ssh-config add --update -p "server_*" IdentityFile="~/.ssh/cmd_id_rsa"

add ssh key to multiple servers

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

Release files for ssh-config 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ssh-config 0.0.12
File Size Uploaded
ssh_config-0.0.12.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ssh-config 0.0.12
File Interpreter ABI Platform
ssh_config-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / ssh_config-0.0.12.tar.gz

Download URL ssh_config-0.0.12.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1c7b62222d166df5e707f54bd0520ef32cfa50604c369b84eff94b1b91d53258
BLAKE2b-256 checksum
How to use checksums
b3a272ca9d7c0b181b58d462647421ba1531ce3a62ca9b1c8b65c29c3a0349b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / ssh_config-0.0.12-py3-none-any.whl

Download URL ssh_config-0.0.12-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fde5b63b7e02bcedec2c994d081714198635f47e3eaa5720696e1fb2f440bbc5
BLAKE2b-256 checksum
How to use checksums
11cd72dcbc6723b0b5cfebc6a7d6a2bdfc23b68c84f9c01d024d8295e92603ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release history Release notifications | RSS feed

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.22

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.14

2 release files

This release

0.0.12 This release

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page