This will help you set up two functions to manage your login status when using two-factor authentication with the aws-cli
tool.
Of course, the auth tokens only live within the terminal session's environment, and are not persistent.
You will need to start a new terminal session after following the instructions.
When done, you can perform any aws
tasks without authenticating, like below.
aws-login 123456
aws s3 sync s3://bucket/file .