ssh client config manager
Project description
SSH Config
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
After 0.0.15, Python27 is not supported. Python 2.7, 3.6, 3.7
Installation
$ pip install ssh-config
Usage
ssh-config <version>
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
rm Remove exist Host configuration
init Create ~/.ssh/config file
import Import Hosts from csv file to SSH Client config
export Export Hosts to csv format
bastion Bastion register/use
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 {}
Project details
Release history Release notifications | RSS feed
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.0.22.tar.gz
(11.2 kB
view details)
Built Distribution
File details
Details for the file ssh_config-0.0.22.tar.gz
.
File metadata
- Download URL: ssh_config-0.0.22.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dc20b081be2c72f8fea69b912fe1fe2013d500b428031a1e84ba1ef5c76d970 |
|
MD5 | 0ed60e6bb301a3349e786a13dc333c2c |
|
BLAKE2b-256 | 1e8ea2254232250e11f614aac4cbdca8ac89db0dbad635cfb675884bbd70d582 |
Provenance
File details
Details for the file ssh_config-0.0.22-py3-none-any.whl
.
File metadata
- Download URL: ssh_config-0.0.22-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e49e28ce255a6de68d8334e946c285b49758719a10d041b2bdb0c723f821350 |
|
MD5 | 8830b495f49c791a2d8215d6d53090ce |
|
BLAKE2b-256 | 27c792267db733e4d1140abf90c49e516d5070fc4d15cff2000f59974cd733f4 |