Cookie policy

EU e-Privacy Directive

This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

You have declined cookies. This decision can be reversed.

You have allowed cookies to be placed on your computer. This decision can be reversed.

Article Index

Once CompaSSH has been installed and configured it must be connected to OpenSSH. The configuration is very simple and involves just  adding one single line in the ~/.ssh/config file:

Host *
    ProxyCommand /usr/libexec/compassh/compassh_proxy %h %p

If your config doesn't have a Host * section, just define one and add this line. I suggest adding some more directives. Mine for example is:

Host *
    ServerAliveCountMax 20
    ServerAliveInterval 15
    TCPKeepAlive yes
    ProxyCommand /usr/libexec/compassh/compassh_proxy %h %p

Now OpenSSH will call compassh_proxy for any connection you request. compassh_proxy will setup a permanent VPN, create the SOCKS proxy at specified local_port and setup any port forwarding you desire.

Right, what about port forwarding? We just set up the SOCKS proxy. What if I need to forward remote port 1234 on my host? Well, this kind of setup must me configured in a file called ~/.ssh/config.VPN_name. So, for example, we must create two files called ~/.ssh/config.strumentiresistenti and ~/.ssh/ and define any port forwarding as shown here:

# ~/.ssh/config.strumentiresistenti
Host *
        LocalForward 10001 localhost:10001
        LocalForward 1234
        LocalForward 4001

When the VPN is fired up, the local ports 10001, 1234 and 4001 are forwarded.

  The Cog In The Machine On Which All Depends