Martin Nielsen
Martin Nielsen

Reputation: 2047

Creating a git repo on a remote server from a local machine

I have a Debian server containing a GIT repository. A number of users are restricted to only use the "Git_Shell" when they log in via ssh. Is it possible for these users to somehow initiate new repositories on the remote server, of cause given that they have write rights to the directory they try to access?

Say, that Bruno wants to create a new repository in his /home/bruno dir, how would he do this when being restricted to the 'git_shell'?

Upvotes: 1

Views: 43

Answers (1)

VonC
VonC

Reputation: 1324278

As mentioned in "Git shell not enabled?", a 'help' should list the commands available.

Those are restricted to the ones in the user directory git-shell-commands, and you could add one which creates a git repo.

The article "Hosting an admin-friendly git server with git-shell" adds:

it turns out that if you create a directory with this name in the Git user's home directory, any executable files you place inside the directory will become accessible through an interactive shell when you su up or SSH into the git user.
If you create a script named help, it will get executed when the shell starts.
Kind of cool, and really handy for making your Git server more friendly :-)

Upvotes: 1

Related Questions