I have a git server that is behind a firewall. I can access the firewall from my home, but not the git server. However, I can access the git server from the firewall (that is, I can SSH to the firewall and then SSH from the firewall to the git server). I am looking to push and pull to the git repos from my home machine, and I thought the SSH ProxyCommand would do it. So I added the following to my SSH config file:
Host git_server
HostName git_server.dom
User user_git_server
IdentityFile ~/.ssh/id_rsa
ProxyCommand ssh firewall exec nc %h %p
Host firewall
HostName firewall.dom
User user_firewall
IdentityFile ~/.ssh/id_rsa
With this setup, I can directly SSH to the git server by doing ssh git_server
. However, git commands that need to talk to the server do not work. git remote show origin
fails with the message:
ssh: connect to host git_server.dom port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
The url of the origin repo is
ssh://user_git_server@git_server.dom/path/to/bare/repository/repo.git
I think I have most of the things in place, but am missing a small crucial piece. Any pointers to what I could be doing wrong?