Self-hosted SSH Proxy: Difference between revisions

(Created page with "=== SSH Port Forwarding === The Allegro Network Multimeter can be configured to to use SSH Port Forwarding to allow remote access to the device behind a NAT. The multimeter...")
 
Line 2: Line 2:


The Allegro Network Multimeter can be configured to to use SSH Port Forwarding to allow remote access to the device behind a NAT.  
The Allegro Network Multimeter can be configured to to use SSH Port Forwarding to allow remote access to the device behind a NAT.  
The multimeter will create a tunnel to an SSH endpoint and will open a listening port on this SSH server.  
The Multimeter will create a tunnel to an SSH endpoint and will open a listening port on this SSH server.  
This port can now be used to send HTTPS requests to the multimeter.
This port can now be used to send HTTPS requests to the Multimeter.


==== Preparing the SSH server ====
==== Preparing the SSH server ====
Line 22: Line 22:


Paste the line into the file and save/close the file.
Paste the line into the file and save/close the file.
There are two options to access the multimeter:
There are two options to access the Multimeter:


'''Option 1: No proxy'''
'''Option 1: No proxy'''


Advantage:
Advantage:
* no additional software required
* no additional software required.


Disadvantage:
Disadvantage:
* no port < 1024 (as non-root user)
* no port < 1024 (as non-root user).
* Default HTTPS port 443 is not possible
* Default HTTPS port 443 is not possible.


The SSH server might be configured to allow only local listening ports. This has to be changed to allow listening on any subnet.
The SSH server can be configured to allow only local listening ports. This has to be changed to allow listening on any subnet.


Edit the SSH configuration file '''/etc/ssh/sshd_config''' and activate the following line:
Edit the SSH configuration file '''/etc/ssh/sshd_config''' and activate the following line:
Line 44: Line 44:


Advantage:
Advantage:
* use default HTTPS port 443
* uses default HTTPS port 443.
* use several filter mechanisms provided by the proxy software
* uses several filter mechanisms provided by the proxy software.
* use the same SSH server as proxy for several multimeters through SNI routing Disadvantage:
* uses the same SSH server as proxy for several multimeters through SNI routing.
* additional configuration required
 
Disadvantage:
* additional configuration required.


The following block shows a sample configuration for the '''nginx''' proxy server:
The following block shows a sample configuration for the '''nginx''' proxy server:
Line 74: Line 76:
  }
  }


The forwarding to the Allegro Network Multimeter is using the configured server name. In this example, requests to '''allegro-mm-1234.mm-remote.company.com''' will be forwarded to the multimeter.
Forwarding to the Allegro Network Multimeter uses the configured server name. In this example, requests to '''allegro-mm-1234.mm-remote.company.com''' will be forwarded to the Multimeter.
Ths requires that this hostname is resolved by the DNS server. This could be solved by a wildcard DNS CNAME entry to point at the SSH server.
This requires that the hostname is resolved by the DNS server. This can be solved by a wildcard DNS CNAME entry to point at the SSH server.


'''Configuration of the multimeter'''
'''Configuration of the Multimeter'''


In the configuration dialog, insert the parameters to access the SSH server. For example:
In the configuration dialogue, insert the parameters to access the SSH server. For example:


* SSH Host: '''mm-remote.company.com'''
* SSH Host: '''mm-remote.company.com'''
Line 86: Line 88:
* Listening HTTPS Port on SSH Host: '''55443'''
* Listening HTTPS Port on SSH Host: '''55443'''


The settings have to match the configuration above. '''Every multimeter requires a separate HTTPS listening port..'''
The settings have to match the above configuration. '''Every Multimeter requires a separate HTTPS listening port..'''
If the '''SSH user''' is not '''root, no port below 1024''' is possible. Otherwise, an error message will appear when trying to connect.
If the '''SSH user''' is not '''root, no port below 1024''' is possible. Otherwise, an error message will appear when trying to connect.
inactive
369

edits