从 ssh 连接时出现密钥环错误

从 ssh 连接时出现密钥环错误

由于新冠肺炎 (COVID-19),我们在家工作。现在我的工作场所有一台 Linux (Ubuntu) 电脑,其中安装了 TortoiseHG Workbench。我通过 MobaXTerm 通过 ssh 连接到我的计算机。

通常,当我尝试更新存储库时,由于密码和用户保存在密钥环中,它会起作用。现在,当我通过 ssh 连接时,由于 THG 中的错误,我无法更新我的存储库:

** Mercurial Distributed SCM (version 4.5.3)
** Extensions loaded: mercurial_keyring, extdiff, rebase, strip, histedit, tortoisehg.util.hgcommands, tortoisehg.util.partialcommit, tortoisehg.util.pipeui, tortoisehg.util.hgdispatch
Traceback (most recent call last):
  File "/usr/bin/hg", line 41, in <module>
    dispatch.run()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 88, in run
    status = (dispatch(req) or 0) & 255
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 183, in dispatch
    ret = _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 324, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 332, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/usr/lib/python2.7/dist-packages/mercurial/scmutil.py", line 154, in callcatch
    return func()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 314, in _runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 918, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 673, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 926, in _runcommand
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 915, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1197, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 4764, in serve
    return server.runservice(opts, initfn=service.init, runfn=service.run)
  File "/usr/lib/python2.7/dist-packages/mercurial/server.py", line 107, in runservice
    return runfn()
  File "/usr/lib/python2.7/dist-packages/mercurial/commandserver.py", line 339, in run
    return sv.serve()
  File "/usr/lib/python2.7/dist-packages/mercurial/commandserver.py", line 292, in serve
    while self.serveone():
  File "/usr/lib/python2.7/dist-packages/mercurial/commandserver.py", line 267, in serveone
    handler(self)
  File "/usr/lib/python2.7/dist-packages/mercurial/commandserver.py", line 251, in runcommand
    ret = (dispatch.dispatch(req) or 0) & 255 # might return None
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 183, in dispatch
    ret = _runcatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 324, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 332, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/usr/lib/python2.7/dist-packages/mercurial/scmutil.py", line 154, in callcatch
    return func()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 314, in _runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/tortoisehg/util/hgdispatch.py", line 23, in _dispatch
    return orig(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 918, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 673, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 926, in _runcommand
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 915, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1197, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1197, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/rebase.py", line 1771, in pullrebase
    ret = orig(ui, repo, *args, **opts)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1197, in check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 3990, in pull
    other = hg.peer(repo, opts, source)
  File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 181, in peer
    return _peerorrepo(rui, path, create).peer()
  File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 156, in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create)
  File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 497, in instance
    inst._fetchcaps()
  File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 239, in _fetchcaps
    self._caps = set(self._call('capabilities').split())
  File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 407, in _call
    fp = self._callstream(cmd, **args)
  File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 336, in _callstream
    resp = self._openurl(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 193, in _openurl
    ret = self._urlopener.open(req)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 467, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 916, in http_error_401
    url, req, headers)
  File "/usr/lib/python2.7/dist-packages/mercurial/url.py", line 422, in http_error_auth_reqed
    self, auth_header, host, req, headers)
  File "/usr/lib/python2.7/dist-packages/mercurial_keyring.py", line 565, in basic_http_error_auth_reqed
    return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
  File "/usr/lib/python2.7/urllib2.py", line 894, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.7/dist-packages/mercurial/url.py", line 426, in retry_http_basic_auth
    realm, urllibcompat.getfullurl(req))
  File "/usr/lib/python2.7/dist-packages/mercurial_keyring.py", line 556, in find_user_password
    return self._pwd_handler.find_auth(self, realm, authuri, req)
  File "/usr/lib/python2.7/dist-packages/mercurial_keyring.py", line 386, in find_auth
    pwmgr, realm, authuri, skip_caches=after_bad_auth)
  File "/usr/lib/python2.7/dist-packages/mercurial_keyring.py", line 349, in get_credentials
    keyring_pwd = password_store.get_http_password(keyring_url, actual_user)
  File "/usr/lib/python2.7/dist-packages/mercurial_keyring.py", line 164, in get_http_password
    self._format_http_key(url, username))
  File "/usr/lib/python2.7/dist-packages/mercurial_keyring.py", line 206, in _read_password_from_keyring
    password = keyring.get_password(KEYRING_SERVICE, pwdkey)
  File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 41, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/usr/lib/python2.7/dist-packages/keyring/backends/SecretService.py", line 66, in get_password
    collection = self.get_preferred_collection()
  File "/usr/lib/python2.7/dist-packages/keyring/backends/SecretService.py", line 60, in get_preferred_collection
    raise InitError("Failed to unlock the collection!")
keyring.errors.InitError: Failed to unlock the collection!
** Unknown exception encountered with possibly-broken third-party extension mercurial_keyring
** which supports versions unknown of Mercurial.
** Please disable mercurial_keyring and try your action again.
** If that fixes the bug please report it to https://bitbucket.org/Mekk/mercurial_keyring/issues
** Python 2.7.17 (default, Apr 15 2020, 17:20:14) [GCC 7.5.0]
** Mercurial Distributed SCM (version 4.5.3)
** Extensions loaded: mercurial_keyring, extdiff, rebase, strip, histedit, tortoisehg.util.hgcommands, tortoisehg.util.partialcommit, tortoisehg.util.pipeui, tortoisehg.util.hgdispatch
cmdserver: process exited unexpectedly with code 1

据我了解,钥匙圈恶魔尚未启动。我做了一些研究,但找不到启动正确代理的方法。 Ubuntu Gnome 是否有一个特殊的密钥环,仅在桌面环境启动时启动?我怎样才能启动该服务?

答案1

您可以在主机上启动 GNOME 密钥环,例如以下这些 指示

但是,如果您访问的是普通台式电脑,则可能已经有一个 X 会话,只是被锁定。如果是这种情况,您只需与 ssh 会话共享这些凭据即可。那么,你只需要共享访问守护进程的凭据

$ 源 $HOME/.dbus/session-bus/*-0

也可以看看其他选择

答案2

我遇到了同样的错误,gimme-aws-creds 和 awslogin 不起作用。我登录到 ubuntu 20 图形用户界面,然后注销,一切都像往常一样通过 SSH 再次开始工作

相关内容