I created a user name git. And here’s the passwd file:
git:x:1001:1001:git:/home/git/test.git:/bin/bash
Then created a bared repo named ‘test.git’. The full path is ‘/home/git/test.git’.
If I add the remote like beblow, it will works:
git add remote origin git@abc.com:./
But I wonder if below will work? Do I need some addition settings in git?
git add remote origin git@abc.com
It’s not clear why you want to have your server setup as you suggest – it’s certainly not normal.
git as a bash user is INsecure
if you leave your git config as it is in the question you are relying on trust alone that anyone who has access as git does not do the following:
Do it the normal way
Setting up a git server, is easy – almost trivial.
if you update your
passwdfile so it looks like this:Then the user git can do absolutely nothing except perform git commands.
As such you’d then do:
git shell is secure
None of these things will work for a user that has git-shell as their login shell:
The only thing it lets you do is effectively pull and push to the remote.