I\'m trying to commit my first Git repository to a gitlab instance, which I\'ve set up on a debian-VM. Everything is going to happen via local network. The following commands ar
I've solved my problem. The given port 1337 wasn't the problem, although it was wrong too, because ssh does not seem to be able to handle a port in url:
Using a remote repository with non-standard port
The Git-url which worked for me was:
git@10.200.3.248:repositories/Matt/test.git
My Git user home dir is located in /home/git/
and the repositories are stored in /home/git/repositories
so i had to add repositories to my Git-path.
The reason why GitLab told me to use the url git@10.200.3.248:1337:Matt/test.git
seems to be a wrong configured Git path in GitLab. I'll try to fix this now.
Edit:
The wrong host was configured in /home/git/gitlab/config/gitlab.yml
. The "host" there must be without port... There is an extra option for the port if needed.
Edit3:
Still unable to push or fetch my test-repository without repositories
in path..
https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide#could-not-read-from-remote-repository
Maybe something to do with rsa-keys but I don't understand how this belongs together.
Edit4: (Problem(s) seem to be solved)
My rsa-keys were ok. The problem was that I've configured my sshd_config to allow only a certain user for ssh-login. I've simply added Git to the list of allowed users AllowUsers mylogin git
Now I don't have to login via password anymore (You never have to login via password if ssh rsa keys are set up correctly) and the path works without "repositories" as it should. Now I understand, that this is just a normal ssh-connection - I hadn't realized this before..
The way I figured it out:
login via terminal as root:
service ssh stop #Current SSH-Connection won't be closed..
/usr/sbin/sshd -d
====debugging mode===
Then in Git Bash:
ssh -Tv git@gitlab.example.com
Afterwards the terminal with sshd running in debug mode has thrown an error that Git is not allowed to login because of AllowUsers...
Don't forget to start your ssh service afterwards:
service ssh start