Editing Reverse SSH Tunnel

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
Without the ability to port forward a network under a NAT, your server is useless. In the case that you are incapable of allowing incoming traffic to certain ports into your network, you can use a reverse tunnel to give tunnel necessary services through another server elsewhere.
Without the ability to port forward a network under a NAT, your server is useless. In the case that you are incapable of allowing incoming traffic to certain ports into your network, you can use a reverse tunnel to give tunnel necessary services through another server elsewhere.


On the proxy server, edit <code>/etc/ssh/sshd_config</code>.
Edit <code>/etc/ssh/sshd_config</code>.


<pre>$ sudo nano /etc/ssh/sshd_config</pre>
<pre>$ sudo nano /etc/ssh/sshd_config</pre>
Line 12: Line 12:
<pre>$ sudo systemctl restart ssh</pre>
<pre>$ sudo systemctl restart ssh</pre>


Finally, you can create the tunnel on the client. The format is <code>ssh -N -R :<local port>:localhost:<remote port> <username>@<remote ip></code>
Finally, you can create the tunnel. The format is <code>ssh -N -R :<local port>:localhost:<remote port> <username>@<remote ip></code>


<pre>
<pre>
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)