Conditions of the message
According this part of the OpenSSH portable source code, two conditions are needed to print this message:
- pseudo-tty allocation is enabled (-t), as you already have noticed
- log level must be different than QUIET
Solution to suppress the message
- Add
-o LogLevel=QUIET
to your ssh
command line.
- Edit ~/.ssh/config and add
LogLevel QUIET
under relevant Host
blocks.
For example, I use this line in a sh script connecting to several servers to run Docker commands, some potentially interactive:
SSH = "ssh -t -o LogLevel=QUIET"
Warning: any error is discarded
A drawback of this method is this also suppresses SSH fatal errors.
$ ssh -t -o LogLevel=QUIET notexisting.notld ssh anotherone.notld
$
Alternative: log stderr output instead of printing it
If stderr is still considered important to get, an alternative is to redirect stderr to syslog instead, with ssh -t -y
(but then you'd flood your log with all those Shared connection to <host> closed
messages).
It looks like you should be using local port-forwarding instead of remote port-forwarding. You may want to refer to the following helpful blog post by Dirk Loss:
It includes the following illustrative diagram:
In order to read the diagram you need to know that it describes the relationships between 4 different roles involved in creating and utilizing an SSH tunnel:
- an ssh client (i.e.
ssh
- the OpenSSH command-line client) used to establish the tunnel;
- an ssh server (i.e.
sshd
- the OpenSSH server daemon) used to maintain the other end of the tunnel;
- an application server (e.g. another ssh server or an http server);
- an application client (e.g. another ssh client or a web-browser) which wants to access the application server via the tunnel.
It's also important to understand that the two different types of forwarding correspond to two different use cases:
Remote forwarding is so called because the forwarding is performed remotely (at the ssh server) rather than locally (at the ssh client). I also find "remote forwarding = reverse forwarding" to be a useful mnemonic.
So as you can see, in order to initiate a connection from an ssh
client at the origin
host through an sshd
server on a proxy jumphost
to a third target
host you would have to use local port-forwarding. Remote port-forwarding is for the case in which you want the entry point to the tunnel to be located at the host running the sshd
server rather than at the host running the ssh
client.
In the man page the local port-forwarding syntax is written as follows:
ssh -L [bind_address:]port:host:hostport user@remote
This can be written more intuitively as the following:
ssh -L [local_bind_address:]local_port:remote_host:remote_host_port user@proxy_host
Or, using your naming conventions:
ssh -L [origin_bind_address:]origin_port:target_host:target_host_port user@jump_host
If we modify your command to use local port-forwarding instead then we end up with the following:
user@origin:~$ ssh -L *:1234:target:22 myusername@jumphost
Best Answer
You can define a new 'tunnel' in your Subversion configuration (
~/.subversion/config
). Find the section[tunnels]
there and define something like:Afterwards you can contact your repository via the URL
svn+foo://server.com/home/svn/proj1 proj1
.