ARTIFACTORY: Docker pull fails via Artifactory when 2FA is enabled on docker hub Account

AuthorFullName__c
Bandi Harish Goud
articleNumber
000005494
FirstPublishedDate
2022-12-05T15:32:17Z
lastModifiedDate
2025-05-15

ARTIFACTORY: Docker pull fails via Artifactory when 2FA is enabled on docker hub Account

In this article, we will learn why the docker pull fails via Artifactory with an Authentication error when 2FA is enabled on your Docker hub account.

What is Docker registry at JFrog?

A Remote Repository defined in Artifactory serves as a caching proxy for a registry managed at a remote URL such as https://registry-1.docker.io/ (which is the Docker Hub) or even a Docker repository managed at a remote site by another instance of Artifactory.
 

JFrog SaaS: Unlimited Docker Hub access

Artifactory provides JFrog Cloud users with unlimited, high-performance access to Docker Hub and to Docker official images. JFrog Self-Hosted customers are subject to the official docker rate limits. More information can be found under Unlimited Docker Hub Access.

If you have a Docker remote repository enabled with 2FA, pointing to Docker hub and your remote repository is configured with username and password it fails with below Authentication error:

#bandih@bandih-mac % docker login -uadmin cloudserver.jfrog.io
Password: 
Login Succeeded

#bandih % docker pull cloudserver.jfrog.io/docker-remte-2fa/centos
Using default tag: latest
Error response from daemon: unknown: Invalid username/password configured for Remote Docker 
repository: docker-remte-2fa: Error in getting information for 'library/centos/latest/list.manifest.json' 
(java.lang.IllegalStateException: Can't fetch token for repo: docker-remte-2fa realm: https://auth.docker.io/token scope:repository:library/centos:pull).

 

Solution :

In order to resolve this issue, you need to generate a Token from your Docker hub account and update the Artifactory remote repository configuration with username and Token.

User-added image