本文介绍了硬石膏访问修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Linux服务器上设置了gitolite,并将笔记本电脑添加到gitolite-admin存储库中.我被迫格式化笔记本电脑(坏硬盘),因此我需要找出一种重新获得对其他存储库gitolite控件的访问权限的方法.值得一提的是,如果有帮助,我可以在Linux服务器上具有root用户访问权限.我对SSH/公钥等不是很熟练,所以如果有人可以提供帮助,我将不胜感激.

I have set up gitolite on my linux server and added my laptop to the gitolite-admin repository. I was forced to format my laptop (bad hard drive) so I need to figure out a way to regain access to my other repositories gitolite controls. It's worth mentioning, I have root access on my linux server, if that helps. I am not very proficient with SSH/public keys, etc, so if someone can help, I would greatly appreciate it.

推荐答案

如果已安装2.0.3或更高版本,则可以使用gl-admin-push命令从管理存储库的本地克隆中推送:

If you have version 2.0.3 or later installed, you can use the gl-admin-push command to push from a local clone of the admin repository:

请参见 gl-admin-push:绕过gitolite进行gitolite-admin存储库:

  • su给您的Gitolite用户
  • cd /tmp && git clone ~/repositories/gitolite-admin.git
  • 用新密钥替换keydir/中的旧公共密钥,然后提交
  • ~/.gitolite/src/gl-admin-push推动它;这将更新用户的.ssh/authorized_keys以集成您的新密钥
  • su to your Gitolite user
  • cd /tmp && git clone ~/repositories/gitolite-admin.git
  • replace your old public key in keydir/ with your new one, then commit
  • ~/.gitolite/src/gl-admin-push to push it; this will update the user’s .ssh/authorized_keys to integrate your new key

如果使用的版本早于2.0.3,则可以使用gl-dont-panic命令替换密钥:

If you are using something earlier than 2.0.3, you can use the gl-dont-panic command to replace a key:

  • su给您的Gitolite用户
  • 将新的公钥复制到/tmp/username.pub
    username.pub应该与keydir/中当前使用的文件名相同;您可以使用列出现有keydir/的内容

  • su to your Gitolite user
  • copy your new public key to /tmp/username.pub
    username.pub should be the same as a filename that is currently in your keydir/; you can list the contents of the existing keydir/ with

GIT_DIR="$HOME"/repositories/gitolite-admin.git git ls-tree master:keydir

  • 运行cd /tmp && ~/.gitolite/src/gl-dont-panic username.pub以安装替换密钥

  • run cd /tmp && ~/.gitolite/src/gl-dont-panic username.pub to install the replacement key

    这篇关于硬石膏访问修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

  • 09-27 09:48