Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker login: access denied you must use a personal access token

Tags:

docker

gitlab

Trying to login from docker to gitlab using the command:

sudo docker login registry.gitlab.com?private_token=XXX

But I still have the following error message:

Error response from daemon: Get https://registry.gitlab.com/v2/: unauthorized: HTTP Basic: Access denied\nYou must use a personal access token with 'api' scope for Git over HTTP.\nYou can generate one at https://gitlab.com/-/profile/personal_access_tokens

The token has the right access I doubled checked... I am rather new to docker, any hint/help? thanks!

like image 961
Viktor.w Avatar asked Aug 31 '25 01:08

Viktor.w


2 Answers

The correct command line (that works in my case at least) was:

docker login registry.example.com -u <your_username> -p <your_personal_access_token>
like image 167
Viktor.w Avatar answered Sep 12 '25 08:09

Viktor.w


If you are using 2 factor authentication, then personal access tokens are required.

More information on the following webpage,

https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

like image 44
Shaqil Ismail Avatar answered Sep 12 '25 06:09

Shaqil Ismail