{"id":20492596,"url":"https://github.com/rafaelsales/aws-ssh","last_synced_at":"2025-09-09T00:41:46.397Z","repository":{"id":44741534,"uuid":"157928779","full_name":"rafaelsales/aws-ssh","owner":"rafaelsales","description":"A tool that makes easy to SSH into AWS EC2 servers","archived":false,"fork":false,"pushed_at":"2022-01-27T14:57:40.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-13T17:05:23.873Z","etag":null,"topics":["aws","server-management","ssh"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafaelsales.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-16T22:35:12.000Z","updated_at":"2022-01-27T23:53:05.000Z","dependencies_parsed_at":"2022-09-02T06:55:24.647Z","dependency_job_id":null,"html_url":"https://github.com/rafaelsales/aws-ssh","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelsales%2Faws-ssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelsales%2Faws-ssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelsales%2Faws-ssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelsales%2Faws-ssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelsales","download_url":"https://codeload.github.com/rafaelsales/aws-ssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750075,"owners_count":21155685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","server-management","ssh"],"created_at":"2024-11-15T17:29:47.261Z","updated_at":"2025-04-13T17:05:31.995Z","avatar_url":"https://github.com/rafaelsales.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"AWS-SSH\n-----\n\nA tool that makes easy to ssh into AWS EC2 servers\n\nThere's a blog post at [rafaelsales.github.io](https://rafaelsales.github.io/ruby/sqlite/threadsafe/concurrency/2015/08/18/aws-ssh/)\nwith some useful examples of using it:\n\n### Usage\n\n```\n$ gem install aws-ssh\n$ bundle exec aws-ssh --help\n\naws-ssh - a tool that makes easy to ssh into AWS EC2 servers\n\nUsage: aws-ssh [hostname regex]\n\nExamples:\n  $ aws-ssh prod.*app2\n  ... will SSH into the instance and you will see:\n  user@prod-rails-app4~$\n\n  $ aws-ssh --show-only --stack qa -u worker\n  ... will show all instances registered in QA stack of Opsworks\n  ssh worker@10.20.30.40        =\u003e MyApp QA - qa-rails-app\n  ssh worker@10.20.30.41        =\u003e MyApp QA - qa-sidekiq\n\n  # All hosts in one-line (suitable for CSSH):\n  worker@10.20.30.40 worker@10.20.30.41\n\nOptions:\n    -s, --stack        AWS OpsWorks Stack name regex. E.g: `-s prod` will match \"Production\" stack name\n    -p, --profile      AWS config profile name. Default: profile set in .aws-ssh file\n    -r, --region       AWS region. E.g: us-east-1. Default: region set in .aws-ssh file\n    -u, --user         SSH username to use. Default: user set in .aws-ssh file or current machine user\n    -so, --show-only   Only show the matched hosts instead of ssh. Default: false\n    -cs, --csensitive  Use case-sensitive for regex matching. Default: false\n    -v, --verbose      Verbose mode. Default: false\n    --help             Shows help\n```\n\n**SSH into multiple servers at once**\n\nYou can observe the last line of the output contains a whitespace-separated list of servers. We can use that as an input to a Cluster-SSH tool in order to SSH into multiple servers at once. I’m gonna use [tmux-cssh](https://github.com/dennishafemann/tmux-cssh) for example:\n\n```sh-session\n$ tmux-cssh $(aws-ssh -so prod.*app | tail -1)\n```\n\nYou can also create an alias your bash/zsh initialization script to make this even more handy:\n\nDefine the alias:\n\n```\nalias tmux_aws=\"tmux_aws_fn\"\ntmux_aws_fn() {\n  tmux-cssh $(aws-ssh -so $1 | tail -1)\n}\n```\n\nNow you can just do `tmux_aws prod.*app` to SSH into all servers that match this regex\n\n\nDEFAULT OPTIONS\n---------------\n\nUse the [.aws-ssh.sample](https://github.com/rafaelsales/aws-ssh/blob/master/.aws-ssh.sample) as\ntemplate to set default options.\n\nContributing\n------------\n\n1. Fork it ( https://github.com/rafaelsales/aws-ssh/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\nLicense\n-------\n\nPlease see [LICENSE](https://github.com/rafaelsales/aws-ssh/blob/master/LICENSE) for licensing details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelsales%2Faws-ssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelsales%2Faws-ssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelsales%2Faws-ssh/lists"}