gpt4 book ai didi

gitolite - 如何在不使用 gitolite-admin 的情况下向 gitolite 服务器添加 ssh key ?

转载 作者:行者123 更新时间:2023-12-04 14:15:15 27 4
gpt4 key购买 nike

关闭。这个问题是off-topic .它目前不接受答案。












想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。

8年前关闭。




Improve this question




我想从新工作站向我的 gitolite 服务器添加一个 ssh key 。
我无法通过 gitosis-admin 来完成,因为我无法克隆它,而且我无法访问我以前的笔记本电脑,其中包含我用来安装 gitolite 的 ssh key 。

如何在不克隆 gitosis-admin 的情况下将我的新 key 添加到 gitosis-admin/keydir?

谢谢

最佳答案

The "Don't panic" page可以提供帮助(对于 gitolite V3 ,而不是 old obsolete gitosis ):

丢失管理员 key /访问权限

If you lost your gitolite admin key or access, here's what you do. We'll assume your username is 'alice'.

  • Make yourself a new keypair and copy the public key to the server as 'alice.pub'.
  • Log on to the server, and run gitolite setup -pk alice.pub.

That's it; the new alice.pub file replaces whatever existed in the repo before.



这将允许您使用 gitolite-admin 的克隆添加 key 。 repo ,你应该这样做。

这不会“重置”您的 gitolite.conf 文件或您的 gitolite-admin 存储库中的任何内容:它将完成 ~/.ssh/authorized_keys文件。
它当然对您现有的存储库没有影响。

话虽如此,如果 gitolite 命令看起来风险太大,您可以尝试第二种方法:

绕过gitolite

You may have lost access because of a conf file error, in which case the above trick won't help. What you want is to make changes to the repo (or perhaps just rewind) and push that. Here's how to do that:

  • Log on to the server.
  • Clone the admin repo using the full path: git clone $HOME/repositories/gitolite-admin.git temp.
  • Make whatever changes you want -- add/replace a key, 'git revert' or 'git reset --hard' to an older commit, etc. Anything you need to fix the problem, really.
  • Run gitolite push (or possibly gitolite push -f). Note that's 'gitolite push', not 'git push'.

NOTE: gitolite does no access checking when you do this!

关于gitolite - 如何在不使用 gitolite-admin 的情况下向 gitolite 服务器添加 ssh key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14199550/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com