https://github.com/bencromwell/sshush
SSH config management from YAML files, with groups
https://github.com/bencromwell/sshush
ssh ssh-config
Last synced: 12 months ago
JSON representation
SSH config management from YAML files, with groups
- Host: GitHub
- URL: https://github.com/bencromwell/sshush
- Owner: bencromwell
- License: mit
- Created: 2017-03-15T09:01:03.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-06-09T09:15:36.000Z (about 2 years ago)
- Last Synced: 2024-10-11T19:09:02.569Z (over 1 year ago)
- Topics: ssh, ssh-config
- Language: Go
- Homepage: https://sshush.bencromwell.com/
- Size: 55.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sshush
## Documentation
Full docs can be found here: https://sshush.bencromwell.com
## Intro
Takes a YAML defined set of SSH configs and produces an SSH config file from it.
Defaults to `~/.ssh/config.yml` for the source and `~/.ssh/config` for the destination.
#### Premise
I wanted a way to manage my SSH config file that allowed me to define an inheritance based structure. This allows you to group hosts together, apply common options and be able to override the options if needs be. For example, maybe you have everything in DigitalOcean on a particular port with a particular user and SSH key, but everything in AWS is different. Or they share ports but not keys.
#### Globals
Options that apply to the catch-all `Host *`.
#### Defaults
Basic options such as a default User or IdentityFile. Can be overridden by group or individual host entries.
#### Example
Example config demonstrating the use of the global and default options:
```yaml
---
global:
UseRoaming: "no"
default:
User: ben
IdentityFile: ~/.ssh/id_rsa
web_servers:
Config:
Port: 2201
IdentityFile: ~/.ssh/digital_ocean
Hosts:
projects-do-1: projects-do-1.example.com
projects-do-2: projects-do-2.example.com
projects-aws:
HostName: projects-aws.example.com
IdentityFile: ~/.ssh/aws
raspberry_pis:
Config:
User: pi
Hosts:
pi1: 192.168.0.107
pi2: 192.168.0.108
local:
Hosts:
router:
HostName: 192.168.0.1
User: root
kodi: 192.168.0.200
work:
Config:
User: bcromwell
Hosts:
workpc: 10.0.0.80
gitlab: 10.0.0.30
jenkins: 10.0.0.20
```
#### Installation
Grab a release from the GitHub releases page.
### Notes
This was originally written in Python, which can be found in the 1.x branch.