Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bergo/hcloud-local-ssh-config
Generate local ssh config file based on hetzner cloud projects
https://github.com/bergo/hcloud-local-ssh-config
go golang hcloud hetzner hetzner-cloud
Last synced: 2 months ago
JSON representation
Generate local ssh config file based on hetzner cloud projects
- Host: GitHub
- URL: https://github.com/bergo/hcloud-local-ssh-config
- Owner: bergo
- Created: 2021-02-07T14:18:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-15T15:22:08.000Z (almost 3 years ago)
- Last Synced: 2024-08-03T15:17:06.655Z (6 months ago)
- Topics: go, golang, hcloud, hetzner, hetzner-cloud
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - bergo/hcloud-local-ssh-config - Generate local ssh config file based on hetzner cloud projects (golang)
README
# HCLOUD LOCAL SSH CONFIG
The tools helps to generate a local ssh config file based on your hetzner cloud server projects.
It's able perform multiple projects and and set default and custom server configuration per project.
The result configuration content is attached or replaced to a existing config file. It is using generated markers to identify the generated content for a later replacement.
## Install
Build the tool.
make
Configure the projects by setting up the config.json
cp config.json.example config.json
Set the projects with name and token in config.json
## Usage
./hcloud-local-ssh-config --help
Usage of ./hcloud-local-ssh-config:
-config-file string
configuration file (default "config.json")
-marker string
hcloud replacement marker (default "HCLOUD-REPLACE")
-printonly
don't write to file print out only
-ssh-config-file string
ssh configuration file (default "~/.ssh/config")## Result content
The tool adds or replace all servers as host entries in your ssh config file. It uses the public IPv4 as hostname.
Example output:
...
##START HCLOUD-REPLACE ##
Host srv-acme-prod-01
User root
HostName 10.0.0.1Host srv-acme-prod-02
User ubuntu
HostName 10.0.0.2
IdentityFile ~/.ssh/custom_rsa##END HCLOUD-REPLACE ##
...
## License
MIT - Stefan Berger