Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password
docker login was rejected — wrong credentials, or the account requires an access token instead of the password.
Seen on:
Docker
Meaning
Docker Hub accounts with 2FA (and all SSO accounts) need a personal access token as the password. Logging in with an email instead of the username also fails.
Common causes
- Using the password on an account with 2FA/SSO
- Email used instead of Docker ID username
- Expired/revoked access token
- Special characters mangled by the shell
⚡ Quick fix
- Create a personal access token and use it as the password
- Log in with the username, not the email
- Use --password-stdin to avoid shell quoting
Detailed fix by platform
Docker
echo "$DOCKERHUB_TOKEN" | docker login -u myusername --password-stdin
How to diagnose
- Username — Docker ID, not email
- 2FA — Enabled on the account?
- Token — Still valid?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- AADSTS50126 AADSTS50126: Error validating credentials due to invalid username or password
- auth/invalid-credential Firebase Auth: auth/invalid-credential (auth/wrong-password, auth/user-not-found, auth/invalid-login-credentials)
- bad auth : Authentication failed MongoDB: MongoServerError: bad auth : Authentication failed (code 8000 / 18)
Most viewed in Docker
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026