Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronpk/ssh-config-aws
Helper scripts to generate an ~/.ssh/config file automatically from one or more AWS accounts
https://github.com/aaronpk/ssh-config-aws
Last synced: 11 days ago
JSON representation
Helper scripts to generate an ~/.ssh/config file automatically from one or more AWS accounts
- Host: GitHub
- URL: https://github.com/aaronpk/ssh-config-aws
- Owner: aaronpk
- License: apache-2.0
- Created: 2013-12-23T20:12:07.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-12-21T16:21:01.000Z (almost 8 years ago)
- Last Synced: 2024-04-12T19:53:04.998Z (7 months ago)
- Language: Ruby
- Homepage: http://aaronparecki.com/articles/2013/12/23/1/automatically-generate-your-ssh-config-from-aws-hosts-with-tab-complete
- Size: 8.79 KB
- Stars: 31
- Watchers: 5
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Auto-Generate SSH Config from AWS
=================================Helper scripts to generate an `~/.ssh/config` file automatically from one or more AWS accounts.
Setup
-----1. Create a file in the "aws" folder to store your AWS credentials, one file per AWS account
2. In your AWS account, ensure each server has a unique name, and add a "User" tag if the SSH username is different from "ubuntu"
3. Add your existing .ssh/config contents into a file in the "ssh" folder to save any settings or other servers you have there
4. Run `bundle install` to install the necessary gems
5. Source the `bash-complete.sh` file from your `.bash_profile` to enable autocomplete
6. Ensure you have the corresponding SSH private key in your `~/.ssh` folder that matches with the key listed on each EC2Usage
-----**Run `bundle exec ./ssh-servers-from-aws.rb example`**
Replace "example" with the name of your AWS profile. This will query your AWS account for all running servers, adding each to a file in the "ssh" folder.
**Run `rebuild-ssh-config.sh`**
This combines all your `.sshconfig` files into the master `~/.ssh/config` file.
Now you are ready to go! You can do things like:
`$ ssh e[TAB]` -> auto-expands to -> `$ ssh example`
Or if you have multiple servers with the same prefix,
```
$ ssh e[TAB][TAB]
example-1 example-2
```