{"id":15684425,"url":"https://github.com/h3poteto/zsh-ec2ssh","last_synced_at":"2025-06-30T07:37:35.871Z","repository":{"id":147905475,"uuid":"119961519","full_name":"h3poteto/zsh-ec2ssh","owner":"h3poteto","description":"zsh plugin to list up EC2 instances and ssh login the instances.","archived":false,"fork":false,"pushed_at":"2018-04-10T06:30:12.000Z","size":24100,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T16:04:55.663Z","etag":null,"topics":["ec2","ssh","zsh-plugins"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/h3poteto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-02T09:28:59.000Z","updated_at":"2021-11-29T21:33:32.000Z","dependencies_parsed_at":"2023-05-27T21:30:37.640Z","dependency_job_id":null,"html_url":"https://github.com/h3poteto/zsh-ec2ssh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fzsh-ec2ssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fzsh-ec2ssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fzsh-ec2ssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h3poteto%2Fzsh-ec2ssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h3poteto","download_url":"https://codeload.github.com/h3poteto/zsh-ec2ssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252912993,"owners_count":21824065,"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":["ec2","ssh","zsh-plugins"],"created_at":"2024-10-03T17:16:29.986Z","updated_at":"2025-05-07T16:05:19.375Z","avatar_url":"https://github.com/h3poteto.png","language":"Shell","readme":"# zsh-ec2ssh\n\n`zsh-ec2ssh` lists up EC2 instances on your AWS account, and you can choose an instance graphically. Then `zsh-ec2ssh` issues a ssh command to login that instance.\n\nYou often login EC2 instances if you are using AWS. Sometimes, you automate server generation, for example using autoscaling group; therefore, IP Addresses are not fixed.\nIn that case, you need to look up the IP Addresses before ssh login. `zsh-ec2ssh` can make that work easier.\n\n## Demo\n\n![demo](zsh-ec2ssh.gif)\n\nI used shortcut key in the first half of this demo. And next, I wrote `zsh-ec2ssh` command to call the function.\n\n## Install\n### zplug\n\nAfter you setup [zplug](https://github.com/zplug/zplug), write this line in your `~/.zshrc`:\n\n```bash\nzplug \"h3poteto/zsh-ec2ssh\"\n```\n\nand, install.\n\n```bash\n$ zplug install\n```\n\n\n### Manually\n\nCloning from GitHub, and source in your `~/.zshrc`:\n\n```bash\n$ git clone https://github.com/h3poteto/zsh-ec2ssh.git\n```\n\n## Requirements\n\n- [peco](https://github.com/peco/peco)\n- [myaws](https://github.com/minamijoyo/myaws)\n\nAfter you install myaws, please set your AWS credentials in `~/.aws/credentials`:\n\n```\n[default]\naws_access_key_id = XXXXXX\naws_secret_access_key = XXXXXX\n```\n\n## Usage\n### Login an instance\n\nPlease write shortcut setting in your `~/.zshrc`:\n\n```bash\nAWS_PROFILE_NAME=default\nAWS_DEFAULT_REGION=ap-northeast-1\nSSH_USER=h3poteto\nSSH_PRIVATE_KEY_PATH=$HOME/.ssh/id_rsa\nSSH_PORT=22\n\nfunction zsh-ec2ssh-default() { zsh-ec2ssh $AWS_PROFILE_NAME $AWS_DEFAULT_REGION $SSH_USER $SSH_PRIVATE_KEY_PATH $SSH_PORT }\nzle -N zsh-ec2ssh-default\nbindkey '^t' zsh-ec2ssh-default # Ctrl + t\n```\n\n### Using proxy server\n\nIf you prepared proxy server in AWS to login the instance, you can use `zsh-ec2ssh-with-proxy`. At the first, this function lists up EC2 instances to choose the proxy server. Next, this function lists up instances once again to choose the login target server.\n\nPlease write shortcut setting in your `~/.zshrc`:\n\n```bash\nAWS_PROFILE_NAME=production\nAWS_DEFAULT_REGION=ap-northeast-1\nSSH_USER=h3poteto\nSSH_PRIVATE_KEY_PATH=/var/opt/keys/.ssh/private.pem\nSSH_PORT=22\nAWS_PROXY_PROFILE=proxy\nSSH_PROXY_USER=proxy-login-user\nSSH_PROXY_PRIVATE_KEY_PATH=$HOME/.ssh/id_rsa\nSSH_PROXY_PORT=22\n\nfunction zsh-ec2ssh-production-proxy() { zsh-ec2ssh-with-proxy $AWS_PROFILE_NAME $AWS_DEFAULT_REGION $SSH_USER $SSH_PRIVATE_KEY_PATH $SSH_PORT $AWS_PROXY_PROFILE $SSH_PROXY_USER $SSH_PROXY_PRIVATE_KEY_PATH $SSH_PROXY_PORT }\nzle -N zsh-ec2ssh-production-proxy\nbindkey '^p' zsh-ec2ssh-production-proxy # Ctrl + p\n```\n\nYour machine --(ssh using `SSH_PROXY_USER`, `SSH_PROXY_PRIVATE_KEY_PATH` and `SSH_PROXY_PORT`)--\u003e proxy server --(ssh using `SSH_USER`, `SSH_PRIVATE_KEY_PATH` and `SSH_PORT`)--\u003e target server\n\n## Arguments\n### zsh-ec2ssh\n\n|Argument|Description|Default|\n|:---|:---|:---|\n|AWS_PROFILE_NAME|AWS profile name which instances are located.|`AWS_DEFAULT_PROFILE` environment variables|\n|AWS_DEFAULT_REGION|AWS region name which instances are located.|`AWS_DEFAULT_REGION` environment variables|\n|SSH_USER|User name to login the server.|`USER` environment variables|\n|SSH_PRIVATE_KEY_PATH|Private key path of ssh.|`$HOME/.ssh/id_rsa`|\n|SSH_PORT|Port to use ssh.|22|\n\n### zsh-ec2ssh-with-proxy\n\n|Argument|Description|Default|\n|:---|:---|:---|\n|AWS_PROFILE_NAME|AWS profile name which target instances are located.|`AWS_DEFAULT_PROFILE` environment variables|\n|AWS_DEFAULT_REGION|AWS region name which target instances are located.|`AWS_DEFAULT_REGION` environment variables|\n|SSH_USER|User name to login target server.|`USER` environment variables|\n|SSH_PRIVATE_KEY_PATH|Private key path which is used login to target server.|`$HOME/.ssh/id_rsa`|\n|SSH_PORT|Port which is used login to target server.|22|\n|AWS_PROXY_PROFILE|AWS profile name which proxy server are located.|`AWS_DEFAULT_PROFILE` environment variables|\n|SSH_PROXY_USER|User name to login proxy server.|`USER` environment variables|\n|SSH_PROXY_PRIVATE_KEY_PATH|Private key path to login proxy server.|`$HOME/.ssh/id_rsa`|\n|SSH_PROXY_PORT|Port which is used ssh login to proxy server.|22|\n\n## License\n\nThe application is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh3poteto%2Fzsh-ec2ssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh3poteto%2Fzsh-ec2ssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh3poteto%2Fzsh-ec2ssh/lists"}