【问题标题】:gitosis-init error | Traceback (most recent call last)gitosis-init 错误 | Traceback(最近一次通话最后一次)
【发布时间】:2014-08-04 09:50:56
【问题描述】:

大家好,我在设置 gitosis 时遇到了一些错误,我认为它是某种未安装的 python 依赖项

这是我的输出

git@ubuntu-server ~ % sudo -H -u git gitosis-init < /home/git/cs8898_windows7_21.07.2014.pub
Traceback (most recent call last):
  File "/usr/local/bin/gitosis-init", line 9, in <module>
    load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-init')()
  File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 24, in run
    return app.main()
  File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 38, in main
    self.handle_args(parser, cfg, options, args)
  File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/init.py", line 121, in handle_args
    user = ssh_extract_user(pubkey)
  File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/init.py", line 39, in ssh_extract_user
    raise InsecureSSHKeyUsername(repr(user))
gitosis.init.InsecureSSHKeyUsername: Username contains not allowed characters: '----'

希望能得到一些提示,我也会自己尝试一下

【问题讨论】:

  • .pub 文件的用户名中必须有----,这是不允许的

标签: python git failed-installation gitosis


【解决方案1】:

这个错误来自gitosis/init.py#L34-L39:

def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))

这意味着您的公钥文件的内容不是abcd...(long_key)...xxxxx= yourName,而是在末尾包含----

清理其内容或重新生成您的密钥。

【讨论】:

猜你喜欢
  • 2016-09-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-08
相关资源
最近更新 更多