{"id":49,"date":"2024-09-28T22:50:47","date_gmt":"2024-09-28T22:50:47","guid":{"rendered":"https:\/\/dashbenton.com\/blog\/?p=49"},"modified":"2024-09-28T22:50:47","modified_gmt":"2024-09-28T22:50:47","slug":"forward-a-port-ubuntu-server","status":"publish","type":"post","link":"https:\/\/dashbenton.com\/blog\/2024\/09\/28\/forward-a-port-ubuntu-server\/","title":{"rendered":"How To: Forward an HTTPS Port to an Ubuntu Server"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we will show you how to forward a port to an Ubuntu server, basically making an <code>ngrok<\/code>-type server, with no bandwidth limit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Get a server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First, you have to get a server with a public IP address. I use <a href=\"https:\/\/www.linode.com\/\" data-type=\"link\" data-id=\"https:\/\/www.linode.com\/\">Linode<\/a>, but you can use anything that uses an <code>ssh<\/code> command to log in as root. Make the server run Ubuntu (the OS).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the IP address for later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Set up the server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To set up the server, <code>ssh<\/code> into the server and enter the following commands or <a href=\"http:\/\/dashbenton.com\/setup_server-104948.sh\" data-type=\"link\" data-id=\"dashbenton.com\/setup_server-104948.sh\">download the shell file<\/a> and run it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Log in as root\nsudo -s\n# Update the system using apt\napt update &amp;&amp; apt upgrade -y\n# Install socat\napt install socat<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Forward the Windows port<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we are using the port 443. However, you can customize this to your needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From your Windows PC, run the following command as admin, but replace &lt;user> and &lt;ip> to the configuration of your Ubuntu server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -R 8443:localhost:443 &lt;user>:&lt;ip><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will forward the port <code>443<\/code> to the server&#8217;s port <code>8443<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Make it be able to access on Chrome<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To access it on Chrome or whatever browser you are using, you have to run this one final command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>socat TCP4-LISTEN:443,fork TCP4:localhost:8443<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we learned how to set up a port-forwarding solution using an Ubuntu server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you how to forward a port to an Ubuntu server, basically making an ngrok-type server, with no bandwidth limit. 1. Get a server First, you have to get a server with a public IP address. I use Linode, but you can use anything that uses an ssh command to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":1,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/posts\/49\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dashbenton.com\/blog\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}