SSH에서 연결할 때 키링 오류

SSH에서 연결할 때 키링 오류

코로나19로 인해 재택근무를 하고 있습니다. 이제 내 직장에는 TortoiseHG Workbench가 설치된 Linux(Ubuntu) 컴퓨터가 있습니다. 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

제가 아는 한, Keyring Demon은 아직 출시되지 않았습니다. 몇 가지 조사를 했지만 올바른 에이전트를 시작하는 방법을 찾을 수 없습니다. Ubuntu Gnome에는 데스크탑 환경이 시작될 때만 시작되는 특수 키링이 있습니까? 이 서비스를 어떻게 시작할 수 있나요?

답변1

예를 들어 다음과 같이 호스트 시스템에서 GNOME Keyring을 시작할 수 있습니다.이것들 지시하다.

그러나 일반 데스크톱 컴퓨터에 액세스하는 경우 방금 잠긴 X 세션이 이미 있을 수 있습니다. 이 경우 해당 자격 증명을 SSH 세션과 공유하면 됩니다. 그럼, 당신은 단지 필요공유 액세스 데몬에 대한 자격 증명:

$ 소스 $HOME/.dbus/session-bus/*-0

당신은 또한 볼 수 있습니다다른 옵션.

답변2

동일한 오류가 발생했습니다. gimme-aws-creds 및 awslogin이 작동하지 않았습니다. 우분투 20 GUI에 로그인한 다음 로그아웃했는데 SSH를 통해 모든 것이 평소처럼 다시 작동하기 시작했습니다.

관련 정보