{"id":137921,"date":"2021-12-03T15:10:29","date_gmt":"2021-12-03T20:10:29","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=137921"},"modified":"2023-03-21T16:05:44","modified_gmt":"2023-03-21T20:05:44","slug":"port-forwarding","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/port-forwarding\/","title":{"rendered":"Port Forwarding"},"content":{"rendered":"<div id=\"x-forwarding\">\n<p><a name=\"top\"><\/a><\/p>\n<h2>Overview<\/h2>\n<p>Port forwarding allows you to forward a specific port from a remote server to your local computer. This is useful for working with some applications that present streams of information or communicate over a port.<\/p>\n<div class=\"highlight-yellow\"><strong>Do not use port forwarding for graphics windows or programs with graphical user interfaces. Due to the ease of use and excellent performance of the <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/scc-ondemand\/\">SCC OnDemand<\/a> system&#8217;s Desktop session, we recommended its use for these purposes.<\/strong><\/div>\n<p>When forwarding a network port you need to choose a local port number and the port number on the remote system. Typically the remote port number is set by the remote program that you&#8217;re connecting to.\u00a0 For example, the remote program could use port 5904 as shown here.\u00a0 The local port number is one that you pick. Most of the time any reasonable number greater than 1024 will work &#8211; if the port forwarding command tries to use a local port already in use by a running program it will fail with an error message. In these examples a local port value of 7070 is chosen. A local program you run that tries to communicate over local port 7070 will have its network communication forwarded to the remote program listening on port 5904.<\/p>\n<p>Select your operating system below for tailored instructions.<\/p>\n<h4>Select your operating system<\/h4>\n<table border=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><strong><input name=\"os\" id=\"windows1\" onclick=\"show_os('windows')\" value=\"windows\" type=\"radio\" \/><\/strong><br \/>\n<strong> <label for=\"windows1\"><br \/>\nMicrosoft Windows<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"os\" id=\"apple1\" onclick=\"show_os('apple')\" value=\"apple\" type=\"radio\" \/><br \/>\n<strong><label for=\"apple1\"><br \/>\nApple OS X<\/label><\/strong><\/td>\n<td style=\"text-align: center;\"><input name=\"os\" id=\"linux1\" onclick=\"show_os('linux')\" value=\"liux\" type=\"radio\" \/><br \/>\n<strong><label for=\"linux1\"><br \/>\nLinux Distributions<\/label><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><!-- Windows --><\/p>\n<div id=\"windows\">\n<h2>Windows<\/h2>\n<p>Port forwarding on Windows can be accomplished with numerous applications. This section will focus on the MobaXterm application, which was also used in the SSH and FTP guides. Other software options are listed below.<\/p>\n<h4>X-Forwarding Clients<\/h4>\n<ul>\n<li><a href=\"http:\/\/mobaxterm.mobatek.net\/\">MobaXterm<\/a><\/li>\n<li><a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">PuTTY<\/a><\/li>\n<\/ul>\n<h4>Port Forwarding using MobaXterm<\/h4>\n<ul>\n<li>MobaXterm provides a Linux-like command window, where you can execute the port forwarding command:<img loading=\"lazy\" src=\"\/tech\/files\/2013\/10\/img6_small.png\" width=\"596\" height=\"61\" class=\"alignnone\" alt=\"Command-line interface displaying port forwarding command options using MobaXterm on a black background with blue and yellow text.\" \/><\/li>\n<\/ul>\n<\/div>\n<div id=\"apple\">\n<h2>Apple OS X<\/h2>\n<p>Port forwarding is built into the <code><span class=\"command\">ssh<\/span><\/code> utility on Apple computers and is implemented with the &#8220;<code><span class=\"command\">-L<\/span><\/code>&#8221; option.<\/p>\n<pre class=\"code-block\"><code><span class=\"prompt\">localhost $<\/span> <span class=\"command\">ssh -L <\/span><span class=\"placeholder\">7070<\/span>:localhost:<span class=\"placeholder\">5904<\/span> <span class=\"placeholder\">username<\/span>@scc1.bu.edu<\/code><\/pre>\n<p>For more details and advanced configurations, please consult the <code><span class=\"command\">ssh<\/span><\/code> manual page <nobr>( <code><span class=\"command\">man<\/span> ssh<\/code> )<\/nobr> or contact us for assistance.<\/p>\n<\/div>\n<p><!-- Linux --><\/p>\n<div id=\"linux\">\n<h2>Linux<\/h2>\n<p>Port forwarding is built into the ssh utility for the Linux operating system and is implemented with the &#8220;<code><span class=\"command\">-L<\/span><\/code>&#8221; option.<\/p>\n<pre class=\"code-block\"><code><span class=\"prompt\">localhost $<\/span> <span class=\"command\">ssh -L <\/span><span class=\"placeholder\">7070<\/span>:localhost:<span class=\"placeholder\">5904<\/span> <span class=\"placeholder\">username<\/span>@scc1.bu.edu<\/code><\/pre>\n<p>For more details and advanced configurations, please consult the <code><span class=\"command\">ssh<\/span><\/code> manual page ( <code><span class=\"command\">man<\/span> ssh<\/code> ) or contact us for assistance.<\/p>\n<\/div>\n<div id=\"backtotop\"><a href=\"#top\">Back to top<\/a><\/div>\n<p><script type=\"text\/javascript\">\r\nfunction show_os(os){    \r\nif (os == \"windows\"){\r\n \t   document.getElementById('windows').style.display = 'block';\r\n \t   document.getElementById('apple').style.display = 'none';\r\n \t   document.getElementById('linux').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n  \t} \r\nelse if (os == \"apple\"){\r\n \t   document.getElementById('windows').style.display = 'none';\r\n \t   document.getElementById('apple').style.display = 'block';\r\n \t   document.getElementById('linux').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n         }   \r\nelse if (os == \"linux\"){\r\n           document.getElementById('windows').style.display = 'none';\r\n \t   document.getElementById('apple').style.display = 'none';\r\n \t   document.getElementById('linux').style.display = 'block';\r\n           document.getElementById('backtotop').style.display = 'block';\r\n  \t}  \r\nelse{\r\n \t   document.getElementById('windows').style.display = 'none';\r\n \t   document.getElementById('apple').style.display = 'none';\r\n \t   document.getElementById('linux').style.display = 'none';\r\n           document.getElementById('backtotop').style.display = 'none';\r\n     }\r\n }\r\n<\/script><\/p>\n<\/div>\n<p><!-- END div id=x-forwarding --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Port forwarding allows you to forward a specific port from a remote server to your local computer. This is useful for working with some applications that present streams of information or communicate over a port. Do not use port forwarding for graphics windows or programs with graphical user interfaces. Due to the ease of&#8230;<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":137911,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137921"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=137921"}],"version-history":[{"count":12,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137921\/revisions"}],"predecessor-version":[{"id":144207,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137921\/revisions\/144207"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/137911"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=137921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}