Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/awilliams/linode-ssh-config
Generate your ~/.ssh/config file using Linode's API
https://github.com/awilliams/linode-ssh-config
Last synced: about 1 month ago
JSON representation
Generate your ~/.ssh/config file using Linode's API
- Host: GitHub
- URL: https://github.com/awilliams/linode-ssh-config
- Owner: awilliams
- License: mit
- Created: 2014-03-20T16:12:01.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-24T14:55:57.000Z (over 10 years ago)
- Last Synced: 2024-06-20T22:33:03.984Z (7 months ago)
- Language: Go
- Homepage:
- Size: 293 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
linode-ssh-config
=================**Modifies your `~/.ssh/config` file, preserving your exising entries, and appending your Linode hosts.**
# Instead of connecting like
ssh [email protected] -i ~/.ssh/linode-rsa
# Connect like this
ssh MyLinodeLabel
See [Simplify Your Life With an SSH Config File](http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/) for more information about ssh aliases and configuration options.## Download
[Releases](https://github.com/awilliams/linode-ssh-config/releases)
## Quickstart
* [Download](https://github.com/awilliams/linode-ssh-config/releases) the `linode-ssh-config` binary.
* Create a [Linode API key](https://manager.linode.com/profile/api_key_create). (Click on `my profile` -> `API Keys`)
* Create your `linode-ssh-config` config file, editing your API key and other variables.`cp linode-ssh-config.example.ini ~/.linode-ssh-config.ini`
* First test the output.
`./linode-ssh-config`
* Make a backup of your exisiting ssh config
`cp ~/.ssh/config ~/.ssh/config.bak`* **Update the `~/.ssh/config` file.**
`./linode-ssh-config --update`
## UsageThe update command can be run repeatedly, as it replaces any previously generated configuration with the update configuration.
linode-ssh-config --update
## Bash AutocompleteTo enable `ssh` autocompletion, add the following to your bash profile
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh## Pretty Print
See a nicely formatted list of your linodes.
./linode-ssh-config --pp
## Example output
```
# Existing config
Host devbox
User vagrant
IdentityFile ~/.ssh/vagrant.keyHost pi
User pi
StrictHostKeyChecking no##### START GENERATED LINODE-SSH-CONFIG #####
## Production
Host Web1
# Production | Linode ID 123456 | 1024m Ram
Hostname 123.45.67.89
IdentityFile ~/.ssh/linode-rsa
User ubuntuHost DB1
# Production | Linode ID 765432 | 2048m Ram
Hostname 111.11.111.11
IdentityFile ~/.ssh/linode-rsa
User ubuntu## Staging
Host TestWeb1
# Staging | Linode ID 112233 | 1024m Ram
Hostname 128.11.11.11
IdentityFile ~/.ssh/linode-rsa
User ubuntuHost TestDB1
# Staging | Linode ID 765431 | 2048m Ram
Hostname 111.11.111.12
IdentityFile ~/.ssh/linode-rsa
User ubuntu##### END GENERATED LINODE-SSH-CONFIG #####
```