Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot login to Docker account

People also ask

How do I unblock my docker account?

Navigate to Docker Hub and enter your username and password. Click I've lost my authentication device and I've lost my recovery code. Complete the Contact Support form. You must enter the primary email address associated with your Docker ID in the Contact Support form for recovery instructions.

What is my docker ID?

Your Docker ID becomes your user namespace for hosted Docker services, and becomes your username on the Docker Forums. Go to the Docker Hub signup page. Enter a username that is also your Docker ID. Your Docker ID must be between 4 and 30 characters long, and can only contain numbers and lowercase letters.


Edit 2019-04-07:

As this is the currently selected answer, I think people should try @Anish Varghese solution below first as it seems to be the easiest. You only need to install the gnupg2 and pass packages:

sudo apt install gnupg2 pass

If it doesn't work, then you can try my original solution here:

I had the same issue. bak2trak answer worked, but it saved credentials in clear text. Here's the solution if you want to keep them in a password store.

1) Download docker-credential-pass from https://github.com/docker/docker-credential-helpers/releases

2) tar -xvf docker-credential-pass.tar.gz

3) chmod u+x docker-credential-pass

4) mv docker-credential-pass /usr/bin

5) You will need to setup docker-credential-pass (following steps are based of https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452)

5.1) install gpg and pass (apt-get install gpg pass)

5.2) gpg --generate-key, enter your information. You should see something like this:

pub   rsa3072 2018-10-07 [SC] [expires: 2020-10-06]
      1234567890ABCDEF1234567890ABCDEF12345678

Copy the 123... line

5.3) pass init 1234567890ABCDEF1234567890ABCDEF12345678 (paste)

5.4) pass insert docker-credential-helpers/docker-pass-initialized-check and set the next password "pass is initialized" (without quotes).

5.5) pass show docker-credential-helpers/docker-pass-initialized-check. You should see pass is initialized.

5.6) docker-credential-pass list

6) create a ~/.docker/config.json with:

{
"credsStore": "pass"
}

7) docker login should now work

Note: If you get the error "pass store is uninitialized" in future run, run the below command (it will reload the pass store in memory):

pass show docker-credential-helpers/docker-pass-initialized-check

It will ask your password and it will initialize the pass store.

This is based off this discussion: https://github.com/moby/moby/issues/25169#issuecomment-431129898


Install the following Packages in ubuntu fixed my issue

sudo apt install gnupg2 pass

I faced the same issue in ubuntu 18.08 and this finally worked for me.. as a temporary solution.

I had created this folder home/.docker/ as some solutions suggested me to create a file config.json and write default credentials in it i.e.

{
    "credsStore": "pass"
}
  • I deleted this file config.json.
  • Then renamed docker-credential-secretservice to something else so that it doesn't picks up this file.

    sudo mv /usr/bin/docker-credential-secretservice /usr/bin/docker-credential-secretservice_x

and it worked!


This may help too, at least it did in Ubuntu 20.04:

wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.3/docker-credential-secretservice-v0.6.3-amd64.tar.gz && tar -xf docker-credential-secretservice-v0.6.3-amd64.tar.gz && chmod +x docker-credential-secretservice && mv docker-credential-secretservice /usr/local/bin/

https://hackernoon.com/getting-rid-of-docker-plain-text-credentials-88309e07640d  https://github.com/docker/docker-credential-helpers/releases


If apt install gnupg2 pass does not work for you, you can also install golang-docker-credential-helpers package


For me the simplest solution was to create config.json file under .docker directory inside user home directory:

/home/.docker/config.json

Then i copied the content of this file from the server from where i was able to login to the docker hub.

{
        "auths": {
                "https://index.docker.io/v1/": {
                        "auth": "SOMEVALUE"
                }
        },
        "HttpHeaders": {
                "User-Agent": "Docker-Client/18.06.1-ce (linux)"
        }

}

Its a easy workaround, because it doesn't require you to install or update any package which we can't do easily on production servers.


For me docker push failed with

denied: requested access to the resource is denied

... so I wanted to docker login but got the following after entering credentials:

Remote error from secret service:
  org.freedesktop.DBus.Error.UnknownMethod:
  No such interface 'org.freedesktop.Secret.Collection' on object at path
  /org/freedesktop/secrets/collection/login

Error saving credentials:
  error storing credentials - err: exit status 1, out:
  No such interface 'org.freedesktop.Secret.Collection' on object at path
  /org/freedesktop/secrets/collection/login

Luckily, I had another machine available on which I was able to log in without any changes to the system. I copied the content of ~/.docker/config.json...

{
        "auths": {
                "https://index.docker.io/v1/": {
                        "auth": "<some-hash-value>"
                }
        },
        "HttpHeaders": {
                "User-Agent": "Docker-Client/18.09.2 (linux)"
        }
}

... to the other machine and docker push worked.