0

The problem is when i use remote connection string like this:

git@my_ip:admin/repo.git

Everything works fine, but when i use:

ssh://git@my_ip:22/admin/repo.git

I'm getting next error(on git pull):

ssh: connect to host my_ip port 22: No route to host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository
exists.

And yes, i have correct access rights with ssh keys and it works with scp-like connection string absolutely fine.

I also can connect with ssh client(putty) to ssh on port 22, no problem too.

Payalord
  • 463
  • 2
  • 5
  • 16
  • Did my answer solve your question? If so you should mark it as an accepted answer. If you need further information feel free to let me know any questions. – ComputerLocus Jul 19 '16 at 14:14

1 Answers1

1

That is because it is actually trying to login with the user ssh://git, which is why you can't login. The first version is actually using the git user on the system which exists.

You shouldn't need to specify the protocol to use this, as it is already connecting via SSH.

ComputerLocus
  • 3,448
  • 10
  • 47
  • 96
  • Ok let me explain the situation. What i'm trying to do. I have Virtualbox on my windows 7 behind NAT. There is running gitlab and configured static ip on that VM (let say 192.168.0.100) then i configured router to forward everything from port 5555 to 192.168.0.100:22 so because i have static Internet IP i tested does this works and successful connected to my_static_global_ip:5555 via SSH client(putty) works perfect. But with git to setup different port need to use only -> ssh:// because scp-like con.string not allowing to set up custom port. – Payalord Jul 19 '16 at 16:35
  • What i need all this for? I'm trying connect my production server with my local VM to pull from there via my_static_global_ip:port, But looks like this is not git related problem. Because i tried to connect from my production to this IP:port using ssh command. And failed with error message: No route to host. But when i ping from my production that IP:port(IP:5555) it is open and can reach it normal. + If i connect via my SSH client from my comp through this IP:5555 works too. Only production gives me: No route to host. – Payalord Jul 19 '16 at 16:37
  • Okay in that case what you're using in your question should work, but do you mean to be connecting to it with the port of `5555` then instead of `22`? So trying: `ssh://git@my_ip:5555/admin/repo.git`. You can also try setting up the port in the SSH config: http://stackoverflow.com/a/1558735/1044984 – ComputerLocus Jul 19 '16 at 17:40
  • @Payalord Let me know if any of those variations work for you. – ComputerLocus Jul 19 '16 at 17:41