If you have the same problem like me, connecting to a svn server that is only reachable over a gate server, try this:
- Add your root public ssh key to the ~/.ssh/authorized_keys on the gate server.
- And your user public ssh key to the ~/.ssh/authorized_keys on the svn server.
- Try this: ssh -L 24:<svn_server>:22 <gate_login>@<gate_server>
- Now nmap should show something like this:
doep ~ # nmap localhost
PORT STATE SERVICE 24/tcp open priv-mail
#!/sbin/runscript
SSHTUN_OPTIONS="-L 24:<svn_server>:22 <gate_login>@<gate_server> -N"
depend() {
need net
}
start() {
ebegin "Starting sshtun"
start-stop-daemon --start --quiet --exec /usr/bin/ssh --background \
--pidfile /var/run/sshtun.pid --make-pidfile -- $SSHTUN_OPTIONS
eend $?
}
stop() {
ebegin "Stopping sshtun"
start-stop-daemon --stop --quiet --pidfile /var/run/sshtun.pid
eend $?
}
doep ~ # chmod +x /etc/init.d/sshtun
doep ~ # /etc/init.d/sshtun start
doep ~ # rc-update add sshtun default
Host svn
HostName localhost
User <svn_user>
Port 24
doep@doep ~ $ svn switch --relocate http://<svn_server>/svn/repository svn+ssh://svn/var/svn/repos/repository
doep@doep ~ $ svn co svn+ssh://svn/var/svn/repos/repository