通过gitolite配置用户的公钥会引发错误

时间:2012-04-27 11:08:41

标签: git gitolite

我添加了用户的公钥并推送到服务器 但是在运行gl-setup时,我使用了/tmp/id_rsa.pub代替/tmp/rekha.pub

现在我更改了文件名,然后再次尝试运行gl-setup

最后像这样显示消息

rekha.pub maps to user id_rsa, not rekha.
You will not be able to access gitolite with this key.
Look for the 'ssh troubleshooting' link in http://sitaramc.github.com/gitolite/.

如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

首先gl-setupgitolite V2 or 'g2' command 安装的current documentation适用于GitoliteV3 (or 'g3'):升级是明智的(为了便于支持)

查看sources of gitolite,我发现sshkeys-lint将检查gitolite管理员用户:

if ($admin) {
    my $fp = fprint("$admin.pub");
    my $fpu = ( $seen_fprints{$fp}{user} || 'no access' );
    # dbg("fpu = $fpu, admin=$admin");
    die "\t\t*** FATAL ***\n" .
        "$admin.pub maps to $fpu, not $admin.\n" .
        "You will not be able to access gitolite with this key.\n" .
        "Look for the 'ssh troubleshooting' link in http://sitaramc.github.com/gitolite/.\n"
    if $fpu ne "user $admin";
}

根据ssh troubleshooting for g2的说明,您可能需要重试gl-setup rekha.pub 如果失败,请检查您的~gitolite-user-account / .ssh / authorized-keys,并确保id_rsa替换rekha(如果有)。


评论中的OP thillaiselvan报告再次发布了Gitolite:

  

我通过以下方式实现了它:

     
      
  • 替换删除authorized-keys文件中的id_rsa内容。
  •   
  • rekha用户创建了一个新的发布密钥。
  •   
  • 然后新鲜地推它,这是一个巨大的工作。
  •   
     

现在工作正常:)