skip to Main Content

My GPG key recently expired. I created a new key with GPG key,which I can see with gpg. I can see the new public key with ‘gpg –list-keys’. But I get an error from Docker when I do ‘docker login’ with:

Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `exit status 1: gpg: THE_OLD_KEY_ID: skipped: No public key
gpg: [stdin]: encryption failed: No public key
Password encryption aborted.``

But I see my old key, not my new one. How do I make docker login see/use my new key?

2

Answers


  1. Chosen as BEST ANSWER

    For Ubuntu: Step 1: Check if your GPG key expired gpg --list-keys

    If yes, just do the following: STep 2: Make a new key gpg --full-generate-key

    Step 3: put your new key in pass do gpg --list-keys pass init NEW_KEY_ID_HERE ^^^ put your new key in NEW_KEY_ID_HERE

    Step 4: For the OLD, delete it by doing: gpg --delete-key OLD_KEY_ID_HERE

    Step 5: OPEN a terminal with cntrl+N. Perform login command and make sure to check'Save in PasswordManager'. Run the following to make sure that the password for the key (generated in step 2) is in the keychain.


  2. To the best of my knowledge, docker login will log you into dokcerhub. In that case, dockerhub does not support GPG authentication, only password and token.

    Mybe what you’re looking for is using token which can be achieved like below:

    How to Generate a Personal Access Token in Dockerhub:

    1. Log in to your Docker Hub account: Docker Hub.
    2. Go to Account Settings > Security.
    3. Click New Access Token. Use this token in place of your password during docker login.

    In case this is not what you’re looking for, could you please provide more info. Do you get the stated error immediately you type docker login or do you get the error after you input some values after docker login?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search