Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to docker login through CLI - unauthorized: incorrect username or password #935

Closed
subbu05 opened this issue Jan 20, 2017 · 137 comments
Closed
Labels

Comments

@subbu05
Copy link

subbu05 commented Jan 20, 2017

using CLI I am unable to login.

docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: USERNAME@gmail.com
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

OS MAC

docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: darwin/amd64

Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: true

NOTE:
I am able to login when I mention server name.
docker login hub.docker.com
Username (username@gmail.com):
Password:
Login Succeeded

Also I able to login using browser - https://id.docker.com/login

@nick-freitas
Copy link

Your email and your docker id are 2 separate things. It looks like you can use your email to log in the site but not the CLI. To get your docker id log into https://www.docker.com/ with your email and password. On the top right is docker id. Use that in the CLI and you'll probably be fine.

@sandalle
Copy link

sandalle commented Jul 9, 2017

@nick-freitas I was having the same issue and this fixed it for me, thanks!

@Rancho06
Copy link

@nick-freitas This fixed my issue too. Thanks for the clarification.

@mojoblanco
Copy link

Thanks @nick-freitas .... Problem solved!

@lanimall
Copy link

thanks solved here too!

@tchcxp
Copy link

tchcxp commented Aug 2, 2017

Thanks for the clarification

@petertiedemann
Copy link

Just ran into this as well, perhaps this should be made clear in the CLI? It asks for "username", its not surprising that people try to reuse the credentials hub.docker.com is it?

@jamesfry
Copy link

jamesfry commented Aug 8, 2017

Just ran into this too on Docker for Mac - signed into the GUI using email address successfully, so assumed all fine but then CLI tools fail to pull images from dockerhub etc. Slightly confusing!

@ClintEsteMadera
Copy link

Dear Docker developers: this distinction between ID and e-mail is quite 10 years old...please allow users successfully logged into the Docker GUI, automatically be logged when using the CLI...or at the very least allow them to use the default option you are suggesting which is their e-mail address. Thanks!

@dchien234
Copy link

FYI, on Mac, login using Docker ID on CLI is not good enough, you also need to login into the Docker for Mac GUI, then you can pull images. This is confusing too.

@hagnat
Copy link

hagnat commented Aug 27, 2017

imho, docker could either remove the email from the default username, or use email as login field if the user provides an email :P

@sinramyeon
Copy link

How can I re-log in by CLI on Mac? I still have yo log into Docker with email.

@KWenn
Copy link

KWenn commented Sep 7, 2017

docker login

@andyliddle
Copy link

I think this should allow me to set it as i would do if i was running docker normally.

I use Portainer.io and because of this I cannot get portainer to access the docker host its running on.

locahost:2375, 172.0.0.1:2375 or 192.168.192.1:2375 does not work from the container

@rodoxx
Copy link

rodoxx commented Oct 9, 2017

@nick-freitas thanks... solved!

@mcandre
Copy link

mcandre commented Oct 15, 2017

I admit I'm confused. Is CLI docker login separate from the GUI login?

@sinramyeon
Copy link

@mcandre GUI and CLI is separated. If you loggged in by GUI, it doesn't mean you also logged in CLI

@spoobert
Copy link

LOL ME TOO! what a trivial problem that could have cost me some serious time tytyty.

@MetalArend
Copy link

If you login with your email in the GUI (on Docker for Mac), you'll see that in the menu item Repositories stays empty, and you cannot pull (like mentioned before). However, if you logout, and login with your Docker ID instead of your email, everything works fine. There is even no need to login separately in the CLI.

@dmitry-chisw
Copy link

dmitry-chisw commented Nov 18, 2017

Hello everyone. If I use docker login and step-by-step I'm providing a creds, then docker Login Succeeded. But if I'm doing the same via single command, like docker login -u -p, then I got an error. I have noted, that in the first case Docker uses https://index.docker.io/v1/ but in the second it's https://registry-1.docker.io/v2/, then Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password. Why this is happens?

@buildreactive
Copy link

Yea, the UI is very badly done. It will seem to let you login using your email, but this is only logging you in to your Docker account on docker.com as I understand. It does not log you in with the docker hub, and the only indication you have that something is wrong is 1) on a Mac, your repositories menu is empty, and 2) if you try to do "things" that require being logged in with the docker CLI, it won't work. Instead, login with your docker ID (the username you specified when you signed up). Then everything works. (Why the UI lets you login using email is beyond me...)

@jjqq2013
Copy link

Not only for Mac, On my Windows 10 (Docker for Windows, Version 17.09.0-ce-win33 (13620),
I found a strange problem of the UI:
Being able to use docker pull, i sign in from the Docker icon, then i can not use docker pull (with same error as this issue).

@maxtortime
Copy link

maxtortime commented Nov 20, 2017

I also had this issue. (Windows 10) But I resolved this issue by using docker username instead of email at CLI.

@badjano
Copy link

badjano commented Dec 4, 2017

I had problem with my password, I used a password generator to create it and it worked fine on the browser, but on my mac on terminal it wouldn't let me login, the password was: `ZsM2y=3P5vEM\h , so I changed it to only letters and numbers and it worked

@huyngkh
Copy link

huyngkh commented Dec 11, 2017

the first answer solved my problem as well. Thank you!

@CoderPoet
Copy link

you can 'docker login'

@ijbhxhu
Copy link

ijbhxhu commented Dec 15, 2017

Thank you for solve my problem

@gegillam
Copy link

Thumbs up

@PabloEzequiel
Copy link

thanks @nick-freitas ... same error... same solution :)

@mailsanjayhere
Copy link

Thanks @nick-freitas . I relogged into docker with the docker ID that you referenced. And able to download now. thanks much.

@abidmumtaz
Copy link

abidmumtaz commented Jun 20, 2019

Thanks ! - I had the same problem on my macOS Mojave (version 10.14.4 ) but the help above advice helped.
Hope my steps helps any newbies like me.

The problem

Even running the command "docker run hello-world" was failing and giving the following error
"$ docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: unauthorized: incorrect username or password.
See 'docker run --help'."

Worked using the following steps: -

First start and login to your docker desktop app client

  1. Launch the local docker app from MAC launcher using the Docker Whale icon.
  2. Login into the Docker desktop client using your web docker login (in this case I used my email which I signed up with on Docker).
  3. If the login is correct , wait for the Green Dot to appear plus the message "Docker Desktop is now up and running!" in your upper status bar on the mac.

Now The login on the docker CLI using your terminal window (for this I used the my macuserid not the docker ID)

  1. Open a terminal window
  2. Type in the command "docker login"
  3. it prompted me with a default user name which was my email address in brackets (Ignored that) and type in your macuserid you are logged in with
  4. you should be prompted for your password (again use the password for your macuserid you are logged in as)
  5. And then you should have the good news and see "Login Success"
  6. Note: My macuserid is an admin on my mac - not sure if that also makes a difference

After that I could successfully run the command "docker run hello-world"

Hope this helps basic users like me.

@NextZeus
Copy link

NextZeus commented Jun 28, 2019

Test docker login With modify Docker General Config (macOS High Sierra 10.13.3 & Docker Engine:18.09.2)

1. With GUI Account login

image

1.1 With General -> Securely store Docker logins in macOS keychain (checked)

image

docker login failed

image

1.2 With General -> Securely store Docker logins in macOS keychain (unchecked)

image

docker login successed

image

it will Authenticating with existing credentials.


2. With GUI Account logout

image

2.1 With General -> Securely store Docker logins in macOS keychain (checked)

docker login failed

image

2.2 With General -> Securely store Docker logins in macOS keychain (unchecked)

docker login successed

image

SO,

unchecked General->Securely store Docker logins in macOS keychain, it solved my docker login failed problem

@surfnerd
Copy link

FYI, I tried logging in with docker login whilst in a tmux session, and this wasn't working. Could be a tmux configuration issue on Mac. I had to open a vanilla terminal window to login. Then it worked. Thanks.

@seregasheypak
Copy link

seregasheypak commented Jul 11, 2019

It doesn't work :(

lient: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false

UI login worked
image

CLI doesn't

ssa@Sergeys-MacBook-Pro   ~/devel/parity  docker login                                                                                       1 ↵  111  11:00:12 
Authenticating with existing credentials...
Stored credentials invalid or expired
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (serega.sheypak@gmail.com):
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

or

docker login hub.docker.com                                                                                                                                                                                                            SIGINT(2) ↵  110  10:57:21  
Username: seregasheypak
Password: 
Error response from daemon: login attempt to https://hub.docker.com/v2/ failed with status: 404 Not Found

This one works:

docker login                                                                                         ✔  112  11:02:03 
Authenticating with existing credentials...
Stored credentials invalid or expired
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (serega.sheypak@gmail.com): seregasheypak
Password:
Login Succeeded

@Metrakit
Copy link

Test docker login With modify Docker General Config (macOS High Sierra 10.13.3 & Docker Engine:18.09.2)

1. With GUI Account login

image

1.1 With General -> Securely store Docker logins in macOS keychain (checked)

image

docker login failed

image

1.2 With General -> Securely store Docker logins in macOS keychain (unchecked)

image

docker login successed

image

it will Authenticating with existing credentials.

2. With GUI Account logout

image

2.1 With General -> Securely store Docker logins in macOS keychain (checked)

docker login failed

image

2.2 With General -> Securely store Docker logins in macOS keychain (unchecked)

docker login successed

image

SO,

unchecked General->Securely store Docker logins in macOS keychain, it solved my docker login failed problem

Thanks ! You saved my day !!

@cahhvoy
Copy link

cahhvoy commented Jul 16, 2019

Your email and your docker id are 2 separate things. It looks like you can use your email to log in the site but not the CLI. To get your docker id log into https://www.docker.com/ with your email and password. On the top right is docker id. Use that in the CLI and you'll probably be fine.

I still Don't Understand why or How They are different but I changed from Email to docker ID n it Worked, Thanks

@scotself
Copy link

Try first to logout from docker:
$ docker logout

and then pull again. As it is public repo you shouldn't need to login

I was logged into CLI with my email and into GUI with my ID. Logged out from CLI and logged in with ID so both are using ID and all is well. Thanks!

@jdelafon
Copy link

jdelafon commented Sep 8, 2019

I just updated to 2.1.0.2 and had to uncheck the checkbox to be able to log in to docker from CLI again

@jsejcksn
Copy link

jsejcksn commented Dec 3, 2019

Solution

  1. Log out of your Docker account in Docker Desktop
  2. Generate a new access token for your account
  3. Copy the access token
  4. Open a terminal and type docker login -u yourAcutalUsernameNotYourEmailAddress
  5. When prompted for the password, paste your access token that you copied in step no. 3
  6. You are now logged in to your docker account in the terminal and in Docker Desktop

@JOduMonT
Copy link

docker login hub.docker.com

I've also got an issue to connect via CLI but in fact my error was to specify hub.docker.com.
since it is the default registry we, apparently, should not mention it since it is implicit.
(ref: moby/moby#34872 (comment))

so by only using docker login it worked.

@salprima
Copy link

Solution

  1. Log out of your Docker account in Docker Desktop
  2. Generate a new access token for your account
  3. Copy the access token
  4. Open a terminal and type docker login -u yourAcutalUsernameNotYourEmailAddress
  5. When prompted for the password, paste your access token that you copied in step no. 3
  6. You are now logged in to your docker account in the terminal and in Docker Desktop

It works like a charm. I don't know why entering my plain password never worked. This is the real solution. You can use access token both for CLI and Docker Desktop login.

@mehdiminaee
Copy link

using CLI I am unable to login.

docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: USERNAME@gmail.com
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

OS MAC

docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: darwin/amd64

Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: true

NOTE:
I am able to login when I mention server name.
docker login hub.docker.com
Username (username@gmail.com):
Password:
Login Succeeded

Also I able to login using browser - https://id.docker.com/login

FYI Second AUTH maybe affected on it. try without sec auth.

@nanthracite
Copy link

I could not login from the command line, only the web. So I tried docker logout and got the response "# docker logout
Not logged in to https://index.docker.io/v1/"

but I tried docker login again after that and it worked!

@xt94c4t9ce
Copy link

I made an account using the Docker Hub Web page, with ID vxwcRj47WzPk7csC. My password was similar (a long bunch of jumbled characters).

The Web page accepted this and allowed me to log in normally.

But the CLI never worked with it. It always said, "Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password."

I finally gave up and registered a separate account using very tame account name and password values, and everything worked.

So, the CLI seems like it doesn't handle many credential values that the Web page accepts.

Was Docker coded by beginners?

@mariamihai
Copy link

mariamihai commented Aug 10, 2020

Years later and this issue is not resolved...

I was minding my own business, logged everywhere with my username (which I always use), when I "stupidly" tried a mvn clean package docker:build docker:push and got this:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.33.0:build (default-cli) on project xxx: Unable to pull 'openjdk:11-jre-slim' : {"message":"Get https://registry-1.docker.io/v2/library/openjdk/manifests/11-jre-slim: unauthorized: incorrect username or password"} (Internal Server Error:500) -> [Help 1]

Logged out, in, out, created an access token which deserves its description: "stupid need of access token"
Managed to pull the missing image by pulling it by itself (docker pull openjdk:11-jre-slim) but now I cannot push my own image:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.33.0:push (default-cli) on project xxx: Unable to push 'xxx/xxx' : unauthorized: incorrect username or password  -> [Help 1]

And it's not the plugin, used that very one a few days ago to build and push an image.

How is this an issue? How is this possible?

EDIT: Used docker push image_name instead.... toomanyrequests: too many failed login attempts for username or IP address
I feel disrespected...................................

EDIT 2: This comment helped me with the "toomanyrequests" issue. How is this an issue!?

May the Docker God be with you, guys.

@bczoma
Copy link

bczoma commented Nov 4, 2020

Found that on a linux standard docker install login requires root privileges. sudo docker login worked. For non-root user the error message for plain docker login is not helpful - makes you believe something was wrong with the password. See e.g. https://docs.docker.com/engine/install/linux-postinstall/ on how to enable docker for all users, after which sudo is not necessary.

@github-actions
Copy link

github-actions bot commented Jun 2, 2021

We are clearing up our old issues and your ticket has been open for 6 months with no activity. Remove stale label or comment or this will be closed in 15 days.

@stollr
Copy link

stollr commented Jul 16, 2021

I got the same error when trying to login on Linux Debian. Although I did everything right.
Then I found this answer and after installing gnupg2, pass and gpg (sudo apt install gnupg2 pass gpg) the login worked.

Maybe this will help anybody :)

@nanthracite
Copy link

nanthracite commented Jul 16, 2021 via email

@stollr
Copy link

stollr commented Jul 28, 2021

I had to install it on the host machine, which is current Debian stable, Buster.

@AudiArduino
Copy link

I just have the same issue.... after reading and trying multiple things suddenly I found that my DOCKER8HUB username starts with a capital letter whereas after logging it's a small letter.....what a way to deceive people for days

@DevRuibin
Copy link

I had the same issue. I registered docker as "Rueibin" when I tried to login as "Rueibin" I failed but I successfully logined in as "rueibin"

@JustinLuuu
Copy link

@salprima Thank you very much, after reading so many comments that absolutely works !

@AurimasNav
Copy link

I've registered for docker hub using my gmail and was not able to login in cli until I went into my account and chose to reset password, after that cli login works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests