Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Credentials do not work for "docker login"

Copy/pasting my username and password into the Docker Hub website works fine.

The password is long, but does not contain shell-breaking symbols.

Copy/pasting those same credentials into command-line docker login results in an incorrect username or password error. I have tried passing the credentials interactively (both copy/pasting and typing) and through command line args, same result:

# INTERACTIVE
$ 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: [email protected]
Password: <REDACTED>
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

# COMMAND LINE
$ docker login -u [email protected] -p <REDACTED>
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password
like image 462
Rjak Avatar asked Nov 29 '16 17:11

Rjak


People also ask

How do I reset docker credentials?

If you ever change your Windows password, you'll want to head over to your Docker for Windows settings, shared drives, then click “Reset Credentials” under your shared drives.


4 Answers

@mustaccio was correct.

The Docker Hub website allows you to login with either your username OR your email, and the website does not require a case-correct username.

docker login DOES require a case-correct username, and DOES NOT work with your email address.

When I signed up I chose a camel-cased username e.g.:

MyUsername

Docker forces this username to all lower case in practice. When you log in, you'll see your correct username in the upper right-hand corner of the website. In this example:

myusername

The website allows you to login with MyUsername or myusername.

docker login only allows myusername.

like image 183
Rjak Avatar answered Oct 16 '22 23:10

Rjak


Same issue happens if you didn't logout and if you have put EMAIL address for login.

docker logout
docker login

DONOT PUT EMAIL ADDRESS, instead ENTER USERNAME

like image 38
Anto Avatar answered Oct 16 '22 22:10

Anto


I used a password generator that put special characters in my password, I was able to login in my browser but not through the cli. I changed it to just letters and numbers and it worked.

like image 4
gary69 Avatar answered Oct 17 '22 00:10

gary69


Try this:

  1. sudo chmod 666 /var/run/docker.sock
  2. sudo docker login
like image 3
Francesco Mantovani Avatar answered Oct 17 '22 00:10

Francesco Mantovani