Error saving credentials: error storing credentials - err: exit status 1, out: `error getting credentials - 错误:退出状态 1

问题描述 投票:0回答:10

我有 Ubuntu 20.04,我尝试使用

docker 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: sfelshtyn
Password: 
Error saving credentials: error storing credentials - err: exit status 1, out: `error getting credentials - err: exit status 1, out:` no usernames for https://index.docker.io/v1/``
docker ubuntu authentication credentials
10个回答
41
投票

尝试执行以下命令

service docker stop
rm ~/.docker/config.json
service docker start

然后尝试 docker login 它会询问用户名和密码


14
投票

我读过保存凭据时出错:存储凭据时出错-错误:退出状态1,输出:传递存储未初始化来解决我的问题,但都没有帮助。

然后切换到docker官方文档,发现docker安装时没有走credentials management流程

我做了几个步骤

  1. gpg --generate-key
  2. pass init <generated gpg-id public key>
  3. docker pull molly/privateimage

之后我再次尝试 docker login。我传递了我的个人数据,它对我有用。我解决了我的问题。


7
投票

这对我有用-

pass remove -rf docker-credential-helpers

3
投票

以下帮助了我:

  1. rm -rf ~/.password-store/docker-credential-helpers
  2. gpg --generate-key
  3. pass init <generated gpg-id public key>

1
投票

尝试以上所有方法后,问题仍然存在,请使用您的

email id
登录,而不是您的
username


0
投票

当你运行 gpg 命令时。然后在运行 pass init 命令时,传递在 gpg 命令输出中生成的公钥。

$ pass init <pub key from gpg command>


0
投票

我在 config.json 中将“credsStore”的值更改为“wincred”,并且能够使用我的 Windows 凭据登录


0
投票

对我有用

service docker stop
rm ~/.docker/config.json
rm /usr/local/bin/docker-credential-pass
service docker start

基本上,您需要从本地环境中删除您的凭据,(这两个 rm ~ 命令完成这项工作)

如果您遇到权限问题,请使用 sudo


0
投票

我在windows机器上修复如下,

  1. 去你的

    C://Users/YOUR_USER_FOLDER

  2. 进入

    .docker
    文件夹

  3. 删除

    config.json
    文件

  4. 再次尝试登录,成功了


0
投票

对于错误:“pass store is uninitialized”

最有效的解决方案是这个答案:
https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-437389054
(归功于@Ayrat-Kh)

$ pass init <gpg key> 
中传递gpg生成的密钥而不是名称(就像我在答案中看到的那样)真的对我产生了影响,以及之后检查过程的不同命令。

© www.soinside.com 2019 - 2024. All rights reserved.