{"id":14069284,"url":"https://github.com/jhandguy/aws-mfa","last_synced_at":"2025-10-17T09:25:48.555Z","repository":{"id":58322782,"uuid":"530639276","full_name":"jhandguy/aws-mfa","owner":"jhandguy","description":"Authenticate to AWS with MFA 🔐","archived":false,"fork":false,"pushed_at":"2024-04-13T19:02:04.000Z","size":334,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T09:44:07.654Z","etag":null,"topics":["2fa","aws","mfa","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jhandguy.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}},"created_at":"2022-08-30T12:06:47.000Z","updated_at":"2024-07-09T16:40:11.018Z","dependencies_parsed_at":"2023-12-21T21:23:11.288Z","dependency_job_id":"69ce93ac-8485-41f4-82ee-4992c03fbc4e","html_url":"https://github.com/jhandguy/aws-mfa","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":"0.021276595744680882","last_synced_commit":"7016037cac4eded8383334e1a1332543e5237fbe"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhandguy%2Faws-mfa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhandguy%2Faws-mfa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhandguy%2Faws-mfa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhandguy%2Faws-mfa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhandguy","download_url":"https://codeload.github.com/jhandguy/aws-mfa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225297538,"owners_count":17452010,"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":["2fa","aws","mfa","rust"],"created_at":"2024-08-13T07:06:48.299Z","updated_at":"2025-10-17T09:25:48.460Z","avatar_url":"https://github.com/jhandguy.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# aws-mfa\n\n[![Version](https://img.shields.io/crates/v/aws-mfa)](https://crates.io/crates/aws-mfa)\n[![Downloads](https://img.shields.io/crates/d/aws-mfa)](https://crates.io/crates/aws-mfa)\n[![License](https://img.shields.io/crates/l/aws-mfa)](LICENSE)\n[![Build](https://img.shields.io/github/actions/workflow/status/jhandguy/aws-mfa/ci.yaml)](https://github.com/jhandguy/aws-mfa/actions/workflows/ci.yaml)\n[![Release](https://img.shields.io/github/actions/workflow/status/jhandguy/aws-mfa/cd.yaml?label=release)](https://github.com/jhandguy/aws-mfa/actions/workflows/cd.yaml)\n\nAuthenticate to AWS with MFA 🔐\n\n```shell\n➜ aws-mfa\nAuthenticate to AWS with MFA 🔐\n\nUsage: aws-mfa \u003cCOMMAND\u003e\n\nCommands:\n  file  Authenticate to AWS with MFA using config and credentials files\n  env   Authenticate to AWS with MFA using environment variables\n  help  Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\n## Installation\n\n**aws-mfa** is published on [crates.io](https://crates.io/crates/aws-mfa) and can be installed with\n\n```shell\ncargo install aws-mfa\n```\n\nor via [homebrew-tap](https://github.com/jhandguy/homebrew-tap) with\n\n```shell\nbrew install jhandguy/tap/aws-mfa\n```\n\nor downloaded as binary from the [releases page](https://github.com/jhandguy/aws-mfa/releases).\n\n## Usage\n\n### Config and credentials files\n\nAdd default region in `~/.aws/config`:\n```text\n[profile \u003cprofile_name\u003e-noauth]\nregion = \u003caws_region\u003e\n\n[profile \u003cprofile_name\u003e]\nregion = \u003caws_region\u003e\n```\n\nAdd basic credentials in `~/.aws/credentials`:\n\n```text\n[\u003cprofile_name\u003e-noauth]\naws_access_key_id = \u003caws_access_key_id\u003e\naws_secret_access_key = \u003caws_secret_access_key\u003e\n```\n\n\u003e **Note**: make sure to add the `-noauth` suffix to the profile name\n\nRun the `aws-mfa file` command:\n```shell\naws-mfa file -p \u003cprofile_name\u003e -c \u003cmfa_code\u003e\n```\n\nCheck generated credentials in `~/.aws/credentials`:\n```shell\ncat ~/.aws/credentials\n```\n```text\n[\u003cprofile_name\u003e]\naws_access_key_id = \u003caws_access_key_id\u003e\naws_secret_access_key = \u003caws_secret_access_key\u003e\naws_session_token = \u003caws_session_token\u003e\naws_session_expiration_timestamp = \u003caws_session_expiration_timestamp\u003e\n```\n\n### Environment variables\n\nExport default region and basic credentials as environment variables:\n\n```shell\nexport AWS_REGION=\u003caws_region\u003e\nexport AWS_ACCESS_KEY_ID=\u003caws_access_key_id\u003e\nexport AWS_SECRET_ACCESS_KEY=\u003caws_secret_access_key\u003e\n```\n\nEval the `aws-mfa env` command:\n```shell\neval $(aws-mfa env -c \u003cmfa_code\u003e)\n```\n\nCheck exported environment variables:\n```shell\nenv | grep AWS_\n```\n```text\nAWS_REGION=\u003caws_region\u003e\nAWS_ACCESS_KEY_ID=\u003caws_access_key_id\u003e\nAWS_SECRET_ACCESS_KEY=\u003caws_secret_access_key\u003e\nAWS_SESSION_TOKEN=\u003caws_session_token\u003e\nAWS_SESSION_EXPIRATION_TIMESTAMP=\u003caws_session_expiration_timestamp\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhandguy%2Faws-mfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhandguy%2Faws-mfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhandguy%2Faws-mfa/lists"}