gitolite は authorized_keys ファイルに既に存在するユーザーを許可します

gitolite は authorized_keys ファイルに既に存在するユーザーを許可します

私はリポジトリの権限を制限するために gitolite を使用していますが、gitolite 経由ではなく、authorised_keys に公開キーがすでに追加されているユーザーでクローンしてプッシュしようとするまではうまく機能していました。問題は、サーバーにアクセスできるキーを使用していることだと思います。server:reponame をクローンしようとすると、リポジトリが存在しないというエラーが表示され、repositories/reponame からクローンしてプッシュしようとすると、次のエラーが表示されます。

Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 370 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Empty compile time value given to use lib at hooks/update line 6
remote: Use of uninitialized value in require at hooks/update line 7.
remote: Can't locate Gitolite/Hooks/Update.pm in @INC (@INC contains:  /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at hooks/update line 7.
remote: BEGIN failed--compilation aborted at hooks/update line 7.
remote: error: hook declined to update refs/heads/master

すでにサーバーへのアクセス権を持っているユーザーに、gitolite リポジトリへの権限を与える方法はありますか? ユーザー用に別のキーを使用して、それを gitolite keydir に追加できることはわかっていますが、これらのユーザーが gitolite リポジトリにもアクセスできる方がはるかに自然です。

答え1

tl;dr バージョン: gitolite には別のキーファイルを使用します。

遅くてもやらないよりはましだ。

既存のキーファイルをgitolite/keys dirに追加し、git add、git commit、git pushするだけです。gitoliteは次のようなメッセージを生成します。

remote: WARNING: keydir/keyfile_which_was_added.pub duplicates a non-gitolite key, sshd will ignore it

そして/home/git/.ssh/authorized_keys、既存のキーと、

# gitolite start 

そして

# gitolite end

セクション。

セクションの後に既存の(古い)キーを移動しようとしました# gitoliteが、SSH ログインで gitolite メッセージのみが表示され、終了してしまいます。

解決策はギロライト用の別の公開鍵を使用する

関連情報