{"id":19385773,"url":"https://github.com/git719/awslogin","last_synced_at":"2025-08-22T07:12:05.631Z","repository":{"id":144688359,"uuid":"488737519","full_name":"git719/awslogin","owner":"git719","description":"AWS macOS login utility","archived":false,"fork":false,"pushed_at":"2025-01-26T14:10:25.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T17:50:44.262Z","etag":null,"topics":["aws","golang","login","mfa"],"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/git719.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,"zenodo":null}},"created_at":"2022-05-04T20:41:24.000Z","updated_at":"2025-01-26T14:10:29.000Z","dependencies_parsed_at":"2024-06-21T00:27:48.943Z","dependency_job_id":"3054a093-5544-40fd-b195-2fdf1f8f2048","html_url":"https://github.com/git719/awslogin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/git719/awslogin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git719%2Fawslogin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git719%2Fawslogin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git719%2Fawslogin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git719%2Fawslogin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git719","download_url":"https://codeload.github.com/git719/awslogin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git719%2Fawslogin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259302590,"owners_count":22837178,"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","golang","login","mfa"],"created_at":"2024-11-10T10:03:01.731Z","updated_at":"2025-06-11T17:06:24.756Z","avatar_url":"https://github.com/git719.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## awslogin\nA small **macOS** utility to simplify AWS MFA logons from the command line. It allows MFA authentication to any main or federated AWS account profile defined in `~/.aws/credentials`. It expects entries in that file to be formatted with 3 additional variables that are not part of the Amazon specs (read more below). Hehe's an example of how that file should be formatted:\n\n\u003cpre\u003e\u003ccode\u003e\n[default]\naws_access_key_id = AKERNEIDUFENICUQ3NDO\naws_secret_access_key = ilsjkasdUEwlwDUgvD1b7234Fn/lepi0ACmk8upFy\n\n[stag]\nprofile_name = stag\naccount_number = 466692114123\nuser_role = PowerUser\n\n[prod]\nprofile_name = prod\naccount_number = 544492114123\nuser_role = PowerUser\n\n[accountN]\nprofile_name = accountN\naccount_number = 012345114123\nuser_role = Administrator\n\u003c/code\u003e\u003c/pre\u003e\n\nNote that you can also read above and below information by running `awslogin -h`.\n\nIn short, the formatting means that:\n  1. The **default** profile is for the main AWS account where your username is defined\n  2. All other profiles are treated as **federated** AWS accounts you may have access to\n  3. You **must** defined a valid key pair for your **default** profile\n  4. Each profile must have a unique **profile_name** so this utility can identify it\n  5. Each federated profile must have a valid **account_number** and **user_role**\n  6. The `-c` switch can create a fresh skeleton `~/.aws/credentials` file\n\n**NOTE:** This utility introduces and uses three new special variables (profile_name, account_number, and user_role) without breaking any of the original AWS `~/.aws/credentials` file functionality. If you find that this breaks something, please let me know.\n\n## Installation\nThe prefer installation method is with [Homebrew](https://brew.sh):\n  1. `brew untap lencap/tools \u0026\u0026 brew tap lencap/tools` to grab the latest formula\n  3. `brew install lencap/tools/awslogin` or `brew upgrade lencap/tools/awslogin`\n  \nAlternatively, you can compile and install manually:  \n  1. Install GoLang (please find out how that's done somewhere else).\n  2. Run `make all` if compiling for the first time, or just `make` if it's a subsequent compile. \n  3. Install the resulting `awslogin` binary somewhere in your PATH.\n\n## Usage\nTo logon to one of your accounts run `awslogin stag TOKEN` where **stag** is one of the **profile_name** defined in your `~/.aws/credentials` file, and **TOKEN** is a 6-digit number from your MFA device. If the logon is successful, it will drop you into a **subshell** from where you can run **awscli** commands. To further verify you've logged on, you can run `env | grep AWS` to view the **AWS_SESSION_TOKEN** environment variable that were generated for this specific session.\n\nOnce you're done with your work, you can exit this subshell to return to your original shell. Note that **this means you can logon to multiple AWS accounts at the same time, using different shell windows**.\n\n## Config file\n\nDon't forget you also need to populate your `~/.aws/config` file, which usually just contains:\n\u003cpre\u003e\u003ccode\u003e\n[default]\nregion = us-east-1\noutput = json\n\u003c/code\u003e\u003c/pre\u003e\n\n### Usage shell output\n\n\u003cpre\u003e\u003ccode\u003e\n$ awslogin\nAWS CLI MFA Logon Utility 1.5.2\nawslogin PROFILE TOKEN   Logon to account PROFILE using 6-digit TOKEN\n         -l              List all account profiles in ~/.aws/credentials\n         -c              Create skeleton ~/.aws/credentials file\n         -h              Show additional help information\n\u003c/code\u003e\u003c/pre\u003e\n\n## Development notes\n\nUses AWS SDK for Go (see http://docs.aws.amazon.com/sdk-for-go/api/), and has been successfully compiled and tested with at least Go v1.8.1 on MacOS Sierra 10.12.5.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit719%2Fawslogin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit719%2Fawslogin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit719%2Fawslogin/lists"}