开发者

Securing a Git Repository

开发者 https://www.devze.com 2022-12-16 12:04 出处:网络
I have a shared hosting package and I have installed git from source. I created a repo and intend to create a couple more, but I was wondering if there is any way to secure the git repository. Current

I have a shared hosting package and I have installed git from source. I created a repo and intend to create a couple more, but I was wondering if there is any way to secure the git repository. Currently I access it over regular http. I do have a shared SSL cert, but开发者_开发知识库 I'm pretty sure that won't be of use here.

Edit: by secure, I mean authenticated, not encrypted.


You can use gitosis to configure fine-grained repository permissions with ssh authentication. However, gitosis needs a separate user account because it takes over that account's ~/.ssh/authorized_keys; the separate account also makes it more secure.

Edit: gitolite doesn't need a separate user account. Here is the tutorial.


If it's http, can you not just use the http server authetication? i.e. .htaccess


You said "authenticated". Well, if you really meant just that, then SSH (even with password access) is good enough. If no one else has access to your server shell account, you're safe.

You need gitolite if you need authorisation in addition to authentication. That is, after sshd (or httpd, if you use git-http-backend) have authenticated the user, you then want to authorise the user to only the repos he/she should have access to.

Nothing in your original question indicates you need that, and I suspect plain SSH access will be good enough for you. Like:

git clone MyUserNameOnSharedHost@my.shared.host:myRepos/foo.git
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号