{"id":18566569,"url":"https://github.com/youyo/awssh","last_synced_at":"2025-04-10T05:32:18.735Z","repository":{"id":47484496,"uuid":"213130900","full_name":"youyo/awssh","owner":"youyo","description":"CLI tool to login ec2 instance.","archived":false,"fork":false,"pushed_at":"2023-02-25T00:57:38.000Z","size":1068,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:46:17.064Z","etag":null,"topics":["aws","ec2","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/youyo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-06T08:09:33.000Z","updated_at":"2022-02-08T02:21:31.000Z","dependencies_parsed_at":"2024-06-20T07:42:50.706Z","dependency_job_id":"ec774b97-d309-4a0d-9ef6-e834ce22af4e","html_url":"https://github.com/youyo/awssh","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fawssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youyo","download_url":"https://codeload.github.com/youyo/awssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248163208,"owners_count":21057889,"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","ec2","golang"],"created_at":"2024-11-06T22:23:33.137Z","updated_at":"2025-04-10T05:32:18.233Z","avatar_url":"https://github.com/youyo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# awssh\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/youyo/awssh)](https://goreportcard.com/report/github.com/youyo/awssh)\n\nCLI tool to login ec2 instance.\n\n- You can close the ssh port in the security group.\n- It is not necessary to register the ssh public key.\n- You don't need to know public ip of ec2 instance.\n\n## Architecture\n\n![architecture](documents/images/awssh.png)\n\n## Install\n\n- Brew\n\n```\n$ brew tap youyo/tap\n$ brew install awssh\n```\n\nOther platforms are download from [github release page](https://github.com/youyo/awssh/releases).\n\n## Requirements\n\n- `ec2-instance-connect` must be possible. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html\n- `port forwarding with amazon-ssm-agent` must be possible. See https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html\n- `session-manager-plugin` command. See https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html\n\n## IAM Policy\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ec2-instance-connect:SendSSHPublicKey\",\n                \"ssm:StartSession\",\n                \"ec2:DescribeSubnets\",\n                \"ec2:DescribeInstances\",\n                \"ec2:DescribeTags\",\n                \"ec2:CreateImage\",\n                \"ec2:CreateTags\"\n            ],\n            \"Resource\": \"*\"\n        }\n    ]\n}\n```\n\n\n## Usage\n\n```bash\n$ awssh\n```\n\n![demo](documents/images/demo.gif)\n\n```bash\n$ awssh --help\nCLI tool to login ec2 instance.\n\nUsage:\n  awssh [instance-id] [flags]\n\nFlags:\n      --cache                     enable cache a credentials.\n      --duration string           cache duration. (default \"1 hour\")\n  -c, --external-command string   feature use.\n  -h, --help                      help for awssh\n  -i, --identity-file string      identity file path. (default \"~/.ssh/id_rsa\")\n  -p, --port string               ssh login port. (default \"22\")\n      --profile string            use a specific profile from your credential file. (default \"default\")\n  -P, --publickey string          public key file path. (default \"identity-file+'.pub'\")\n      --select-profile            select a specific profile from your credential file.\n  -u, --username string           ssh login username. (default \"ec2-user\")\n      --version                   version for awssh\n```\n\n## Examples\n\n### Login to instance\n\n```bash\n$ awssh\n```\n\n### Login to specific instance\n\n```bash\n$ awssh i-instanceid0000\n```\n\n### Custom username and ssh port\n\n```bash\n$ awssh i-instanceid0000 --username admin --port 20022\n```\n\n### Specific identity-file and publickey\n\n```\n$ awssh --identity-file '~/.ssh/custom.pem' --publickey '~/.ssh/custom.pem.pub'\n```\n\n### Use specific aws profile\n\n```\n$ awssh --profile profile-1\n\nor\n\n$ export AWS_PROFILE=profile-1\n$ awssh\n```\n\n### Select aws profile\n\n```\n$ awssh --select-profile\n```\n\n### Enable cache a credentials\n\nIf you use mfa authentication, it may be difficult to authenticate each time.  \n`--cache` option caches credentials and reuses it next time. Cache file is create to `~/.config/awssh/cache/*` .  \n`--duration` options is modify a cache ttl. It is affected by the maximum session duration of the IAM role. Use the AssumeRole API. See https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session .  \n\n```\n$ awssh --cache --duration \"2 hours\"\nAssume Role MFA token code: 000000\n```\n\n![demo-cache](documents/images/demo-cache.gif)\n\n## Author\n\n[youyo](https://github.com/youyo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyo%2Fawssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouyo%2Fawssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyo%2Fawssh/lists"}