Search code examples
pythongitfailed-installationgitosis

gitosis-init error | Traceback (most recent call last)


Hy Guys i got some error while setting up gitosis, i think its some kind of not installed python dependencies

here is my output

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: '----'

Would be nice to get some hints, i will try it my selfe too


Solution

  • This error comes from 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))
    

    That means the content of your pubilc key file isn't abcd...(long_key)...xxxxx= yourName, but includes at the end ----.

    Sanitizes its content or regenerate your keys.