1

Using a fresh Gitlab install, generated and added SSH keys to the user account, created a new project.

From a local machine, created one (1) folder, added a readme and preformed the following from the terminal:

git init
git add README
git commit -m '1_16_2013' 
git remote add origin git@192.168.1.55:root/test.git 
git push -v origin master

The push asks for the git@192.168.1.55's password and returns:

Connection closed by 192.168.1.55
fatal: The remote end hung up unexpectedly

Do I need to add a shh key to my local machine?

Harrison
  • 13
  • 1
  • 4

1 Answers1

1

You need to have the public and private keys (id_rsa and id_rda.pub) stored on your ~/.ssh directory of your local machine.
Otherwise, any ssh to the gitlab server will ask for a password.

You also need to use the right ssh address:

git@192.168.1.55:test.git

You shouldn't have any path in front of the name of the git repo: gitolite (used by GitLab) will detect the name of the repo and will use the right repo path.

I prefer storing this information (server name, ssh user, private key...) in a ~/.ssh/config file: see "gitolite: can connect via ssh, can't clone" as an example (or "git clone git@myserver:gitolite-admin fails").

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Understood. Added the public and private keys to my ~/.ssh directory of my local machine. I am able to push to Gitlab, but I keep running getting a response of 'FATAL: W any test admin_local_host DENIED by fallthru (or you mis-spelled the reponame) '. – Harrison Jan 21 '13 at 16:56
  • @Harrison check out the gitolite logs. You might have more information there. – VonC Jan 21 '13 at 16:59
  • Yup, looks like I need to push to the full path. git@192.168.1.55:root/test.git Do I need to update something to avoid using the full path? – Harrison Jan 21 '13 at 20:21
  • @Harrison pushing with the full path is never a good idea with gitolite: it usually is a sign that you are bypassing gitolite check (http://sitaramc.github.com/gitolite/emergencies.html#ce). So your initial path is good, but your gitolite.conf somehow denies the push. – VonC Jan 21 '13 at 20:47
  • 1
    also as a side... if you have encrypted home directories... you may have to move it to an unencrypted location. i.e. /etc/ssh/username/.ssh/authorized_keys to allow it to be accessible when you're not logged in – engineerDave Jul 23 '13 at 19:34