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

Open
subbu05 opened this issue Jan 20, 2017 · 129 comments
Open

Comments

@subbu05
Copy link

@subbu05 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

@nick-freitas nick-freitas commented May 10, 2017

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 sandalle commented Jul 9, 2017

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

@Rancho06
Copy link

@Rancho06 Rancho06 commented Jul 17, 2017

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

@mojoblanco
Copy link

@mojoblanco mojoblanco commented Jul 21, 2017

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

@lanimall
Copy link

@lanimall lanimall commented Jul 28, 2017

thanks solved here too!

@tchcxp
Copy link

@tchcxp tchcxp commented Aug 2, 2017

Thanks for the clarification

@petertiedemann
Copy link

@petertiedemann petertiedemann commented Aug 3, 2017

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 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

@ClintEsteMadera ClintEsteMadera commented Aug 12, 2017

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!

@DangChien
Copy link

@DangChien DangChien commented Aug 21, 2017

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 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

@sinramyeon sinramyeon commented Sep 6, 2017

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

@KWenn
Copy link

@KWenn KWenn commented Sep 7, 2017

docker login

@andyliddle
Copy link

@andyliddle andyliddle commented Sep 20, 2017

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 rodoxx commented Oct 9, 2017

@nick-freitas thanks... solved!

@mcandre
Copy link

@mcandre mcandre commented Oct 15, 2017

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

@sinramyeon
Copy link

@sinramyeon sinramyeon commented Oct 16, 2017

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

@spoobert
Copy link

@spoobert spoobert commented Oct 28, 2017

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

@MetalArend
Copy link

@MetalArend MetalArend commented Nov 3, 2017

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 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?

@zbeckman
Copy link

@zbeckman zbeckman commented Nov 18, 2017

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

@jjqq2013 jjqq2013 commented Nov 20, 2017

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 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 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 huyngkh commented Dec 11, 2017

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

@CoderPoet
Copy link

@CoderPoet CoderPoet commented Dec 12, 2017

you can 'docker login'

@eric-sandboxsmart
Copy link

@eric-sandboxsmart eric-sandboxsmart commented Dec 15, 2017

Thank you for solve my problem

@gegillam
Copy link

@gegillam gegillam commented Dec 18, 2017

Thumbs up

@PabloEzequiel
Copy link

@PabloEzequiel PabloEzequiel commented Dec 23, 2017

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

@vprasanth
Copy link

@vprasanth vprasanth commented Mar 28, 2019

This is so dump.

@rsanjeeban
Copy link

@rsanjeeban rsanjeeban commented Mar 30, 2019

i see below message when i build my sample docker project. how can i handle this problem?

C:\Users\user\Desktop\docker>docker build -t hello . 
Sending build context to Docker daemon  3.584kB
Step 1/3 : FROM php:7.3-apache
Get https://registry-1.docker.io/v2/library/php/manifests/7.3-apache: unauthorized: incorrect username or password

and below is my dockerfile content

FROM php:7.3-apache
COPY /src  /var/www/html
EXPOSE 88

and my src folder has one "index.php" with below code

<?php
    echo "hello world";
?>

login already successfull
image
its my folder structure
image

@a15zehcheche
Copy link

@a15zehcheche a15zehcheche commented Apr 2, 2019

the username: username@domain.com is not correct, is username only.

@rsanjeeban
Copy link

@rsanjeeban rsanjeeban commented Apr 3, 2019

@a15zehcheche Thank you so much.

@joshmouch
Copy link

@joshmouch joshmouch commented Apr 16, 2019

The Docker for Windows allows you to log in with your email address instead of username. But then this causes problems in the CLI and with Visual Studio interactions. It's very misleading because you think that you're logged in, but you're really not. The web site also allows login using email address.

@waqas80
Copy link

@waqas80 waqas80 commented Apr 30, 2019

@nick-freitas thanks problem solved

@SteveALee
Copy link

@SteveALee SteveALee commented May 6, 2019

For goodness sake!! This should be fixed by now. I just wasted ages. At least give a warning when logging into Desktop UI using email!

@nindipuri
Copy link

@nindipuri nindipuri commented May 15, 2019

Try first to logout from docker:
$ docker logout

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

@buseodaci
Copy link

@buseodaci buseodaci commented May 21, 2019

I'm using linux, i just forgot using sudo su command before using docker. Fixed :)

@YanYii
Copy link

@YanYii YanYii commented Jun 12, 2019

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

@mailsanjayhere
Copy link

@mailsanjayhere mailsanjayhere commented Jun 17, 2019

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 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 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

@surfnerd surfnerd commented Jul 10, 2019

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 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

@Metrakit Metrakit commented Jul 16, 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

Thanks ! You saved my day !!

@cahhvoy
Copy link

@cahhvoy 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

@scotself scotself commented Aug 27, 2019

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 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 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

@JOduMonT JOduMonT commented Feb 12, 2020

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

@salprima salprima commented Apr 23, 2020

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

@mehdiminaee mehdiminaee commented Apr 27, 2020

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

@nanthracite nanthracite commented Apr 28, 2020

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

@xt94c4t9ce xt94c4t9ce commented Aug 3, 2020

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 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 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.

garex referenced this issue in racemap/tz-service Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet