KB: Docker Hub Login Fails on macOS (Keychain Locked)

Problem

Docker Hub login fails in the terminal or Docker Desktop with this error:

Waiting for authentication in the browser… failed to store tokens: error storing credentials - err: exit status 1, out: `The user name or passphrase you entered is not correct. (-25293)`
error storing credentials - err: exit status 1, out: `The user name or passphrase you entered is not correct. (-25293)`

Docker uses the macOS Keychain to store credentials. If the login keychain is locked (common after a session timeout or machine wake), the credential store fails with error -25293.

Fix

Unlock the login keychain before logging in:

security unlock-keychain login.keychain

You will be prompted for your macOS user password. After unlocking, retry docker login or the Docker Desktop login flow.

Notes

  • The keychain can lock automatically based on system idle settings or after the screensaver activates.
  • This affects both docker login from the terminal and the Docker Desktop "Sign In" flow.
  • If the keychain is already unlocked and the error persists, try locking and unlocking it explicitly:
security lock-keychain login.keychain
security unlock-keychain login.keychain

Touch ID Stopped working on MacBook

You need to reset your secure token.

sysadminctl -secureTokenStatus mlr
sysadminctl -secureTokenOff mlr -password - -adminUser Manamana -adminPassword -
sysadminctl -secureTokenStatus mlr
sysadminctl -secureTokenOn mlr -password - -adminUser Manamana -adminPassword -
sysadminctl -secureTokenStatus mlr

On a Mac, a Secure Token is a crucial account attribute that enables users to perform specific, system-level operations, particularly those related to FileVault encryption and system security. It's essentially a permission that allows a user to manage and decrypt encrypted data on the Mac.
Here's a more detailed explanation:

Purpose:

Secure Tokens are used to authorize users to manage FileVault, which is Apple's built-in encryption feature. This includes enabling and disabling encryption, as well as decrypting the system drive.

Refer: https://macpaw.com/how-to/mac-authentication-disabled#:~:text=If%20you%20see%20the%20error,an%20issue%20with%20iCloud%20Keychain.

On a MacBook forcing IPv4

NOTE: Before these change take place you need to turn off/on your WiFi. Also, these changes are persistent and will continue even after reboots.

Turn off IPv6 and for IPv4

networksetup -setv6off Wi-Fi

Enable IPv6

networksetup -setv6automatic Wi-Fi

Toggle WiFi from the command line, but use GUI instead

networksetup -setairportpower en0 off
networksetup -setairportpower en0 on

MacBook Keyboard Shortcuts to Position Window to Left or Right side of Screen

Refer: https://www.paulsahner.com/posts/window-movement

  • Apple Logo, Upper left hand corner
  • System Settings
  • Keyboard, Keyboard Shortcuts...
  • App Shortcuts
  • Choose "All Applications"

You are going to add two settings by clicking the plus key. I'm using [Ctrl]+[Windows]+[Alt]+[Right Arrow] and [Ctrl]+[Windows]+[Alt]+[Left Arrow] for my settings.

You will use the following menu titles, you need to type these EXACTLY, and copy and paste does NOT work, since it assumes you are setting your keyboard combination.

Move Window to Left Side of Screen
Move Window to Right Side of Screen

Save each setting and click "Done" to complete.

Disable IPv6 from the command line on a Macbook

Run a command through the Terminal app:

  • Open Launchpad.
  • Search for Terminal.
  • Click on the Terminal.app.
  • If your active network is WiFi enter the following command:
networksetup -setv6off Wi-Fi
  • If you are on Ethernet:
networksetup -setv6off Ethernet

To re-enable IPv6, you need to replace setv6off to setv6automatic for Wi-Fi or Ethernet:

networksetup -setv6automatic Wi-Fi 
networksetup -setv6automatic Ethernet