Managed OpenStack
Latest
Frequently Asked Questions
Solution
How To
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Using OpenStack CLI With MFA
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
- OpenStack CLI fails with the following after enabling multi-factor authentication (MFA) for a local user.
Bash
xxxxxxxxxx$ openstack server listNot all required auth rules were satisfied: [['totp', 'password']]- OpenStack CLI needs to work for local users with MFA enabled.
Environment
- Platform9 Managed OpenStack - All Versions
- Keystone
- OpenStack CLI
Procedure
- Create the following OpenRC file – substituting the variables with your user information (i.e. enter your username and password, along with the applicable region and project).
Bash
export OS_AUTH_URL=https://<DU>/keystone/v3export OS_REGION_NAME="<REGION>"export OS_PROJECT_NAME="<PROJECT>"export OS_PROJECT_DOMAIN_NAME="default"export OS_USERNAME="<USER>"export OS_PASSWORD="<PASSWORD>"read -p "Please enter MFA Token: " OS_TOTP_PASSCODEexport OS_TOTP_PASSCODE=$OS_TOTP_PASSCODEexport OS_TOKEN=$(curl -s -i -H "Content-Type: application/json" -d '{"auth":{"identity":{"methods":["password","totp"],"password":{"user":{"name":"'"$OS_USERNAME"'","domain":{"id":"default"},"password":"'"$OS_PASSWORD"'"}},"totp":{"user":{"name":"'"$OS_USERNAME"'","domain":{"id":"default"},"passcode":"'"$OS_TOTP_PASSCODE"'"}}},"scope":{"project":{"name":"'"$OS_PROJECT_NAME"'","domain":{"id":"default"}}}}}' -X POST $OS_AUTH_URL/auth/tokens | awk '/X-Subject-Token:/{printf $2}' | tr -dc '[:print:]')export OS_AUTH_TYPE="v3token"- Source the OpenRC file, and use the OpenStack CLI as you would normally.
Bash
xxxxxxxxxxsource openrcAdditional Information
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message