From Hentschel
Jump to: navigation, search

HM server networking

674 bytes added, 08:43, 24 March 2017
/* Setting up VPN via SSHD */
At this point, a request for any host on network B that originates on host hentschel will be answered. At the same time, traffic for hentschel from network B will be directed there via zm.home. Note that the web server on hentschel does '''not''' answer since it's interface is only set to the public interface.
 
=== Automating the login ===
Here a few tricks [at this link http://stackoverflow.com/questions/11543720/how-to-use-ssh-to-run-a-local-command-after-connection-and-quit-after-this-local]
 
Add the following to ~/.ssh/config (client side):
 
<pre>host targetserver
ControlMaster auto
ControlPath ~/.ssh/cm_sockets/%r@%h:%p
</pre>
 
Then this will work:
<pre>
$ ssh -fNT -Llocalport:remoteserver:remoteport targetserver
$ ssh -O check targetserver
Master running (pid=23450)
$ <do your stuff>
$ ssh -O exit targetserver
Exit request sent.
$ ssh -O check targetserver
Control socket connect(/home/sorin/.ssh/cm_socket/sorin@192.0.2.3:22): No such file or directory</pre>