1

I installed a Git server with gitosis in Ubuntu 4.10 64 bits. The server works OK, but a user has asked me to run the command git archive --remote .

http://linux.die.net/man/1/git-archive

This option Git, so I've read, is disabled and has to be enabled by using git-daemon. http://linux.die.net/man/1/git-daemon

I installed the required package for git-daemon:

apt-get install git-daemon-run

And I configured the configuration file /etc/sv/git-daemon/run:

#!/bin/sh

exec 2> & 1

echo 'git-daemon starting.'

exec chpst -ugitdaemon chpst-exec /usr/lib/git-core/git-daemon --verbose --export-all --enable=upload-archive --base-path =/srv/gitosis/git /srv/gitosis/git

Start the service:

sv up git-daemon

From the user's PC run:

$ git archive --remote ssh://gitosis@servername/repository/

And the following error:

ERROR: gitosis.serve.main: Unknown command denied fatal: The remote end hung up unexpectedly

I searched for information and have not found anything. Any idea because it fails?

P.D: Sorry for my English

1
  • Are you trying to run git archive against Github repositiories by any chance? Commented May 3, 2018 at 18:14

1 Answer 1

0

Can you ssh into the server using the gitosis user?

If not this might be a problem with your ssh keys.

7
  • Yes, I can connect from random PC. In fact, I can work with Git repositories. For example, I can clone a repository on a local machine. Commented May 16, 2012 at 12:23
  • With the gitosis user, and with keys not password? what is the result if you run: ssh gitosis@servername /bin/pwd? Should be something like /home/gitosis. Commented May 16, 2012 at 13:11
  • On my computer I have the file ~/.ssh/config with the following information: host servername Port 2022 # I configured git server with this port IdentityFile ~/.ssh/my_key With this configuration, run: ssh gitosis@servername /bin/pwd The following error appears: ERROR: gitosis.serve.main: Unknown command denied Commented May 16, 2012 at 14:06
  • If I delete the ~/.ssh/config and run: ssh -p2022 gitosis@servername /bin/pwd I enter the password and the screen shows me: /srv/gitosis Commented May 16, 2012 at 14:07
  • OK. Then it was the keys.. Go here and follow the guide on how to set it all up: link. See chapter 4. Commented May 16, 2012 at 14:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.