{"id":1390,"date":"2020-09-07T15:54:08","date_gmt":"2020-09-07T07:54:08","guid":{"rendered":"https:\/\/eligiblestore.com\/blog\/?p=1390"},"modified":"2020-09-08T21:18:13","modified_gmt":"2020-09-08T13:18:13","slug":"how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward","status":"publish","type":"post","link":"https:\/\/eligiblestore.com\/blog\/2020\/09\/07\/how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward\/","title":{"rendered":"How to Setup a Forever Free SSH access to Raspberry Pi without port forward"},"content":{"rendered":"<p>My home ISP is using private IP for internet access meaning I can&#8217;t port forward from the router since the public IP actually used by multiple clients \/ houses meanwhile having dynamic IP cost me double, so my options are using <a href=\"https:\/\/ngrok.com\" target=\"_blank\" rel=\"noopener noreferrer\">ngrok<\/a> or <a href=\"https:\/\/www.dataplicity.com\" target=\"_blank\" rel=\"noopener noreferrer\">dataplicity<\/a> or reverse tunnel to a VPS a rather expensive yet convenient. However stumbled upon this medium blog <a href=\"https:\/\/medium.com\/@devinjaystokes\/how-to-setup-an-ad-blocking-wireguard-vpn-server-with-pihole-in-the-cloud-for-free-e814e45aac50\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/medium.com\/@devinjaystokes\/how-to-setup-an-ad-blocking-wireguard-vpn-server-with-pihole-in-the-cloud-for-free-e814e45aac50<\/a>\u00a0got me thinking, hey with the always-eligible-free plan I can SSH my Pi anywhere now, or even better MOSH!!<\/p>\n<h2>CONFIGURING SERVER<\/h2>\n<p>Go ahead register the oracle cloud following the previous blog mentioned, however since I&#8217;m in Asia I am using the server in Japan the closest one that has always-free-eligible tier. There are selection of countries pick the closest one so you can have the best ping.<\/p>\n<p>You can also follow the previous blog on how the setup the VM one thing to note though please just select Canonical Ubuntu 20.04 or even better CentOS although in this blog I am using Ubuntu 20.04. The reason why not choosing Ubuntu 18 is because it always resulting to Ubuntu 18.04 Minimal image and it rather a hassle way to start.<br \/>\n<a href=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1391\" data-permalink=\"https:\/\/eligiblestore.com\/blog\/2020\/09\/07\/how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward\/screen-shot-2020-09-06-at-21-41-26\/\" data-orig-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?fit=1254%2C778&amp;ssl=1\" data-orig-size=\"1254,778\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screen Shot 2020-09-06 at 21.41.26\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?fit=1024%2C635&amp;ssl=1\" class=\"aligncenter wp-image-1391 \" src=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?resize=577%2C358&#038;ssl=1\" alt=\"\" width=\"577\" height=\"358\" srcset=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?resize=1024%2C635&amp;ssl=1 1024w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?resize=300%2C186&amp;ssl=1 300w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?resize=768%2C476&amp;ssl=1 768w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-06-at-21.41.26.png?w=1254&amp;ssl=1 1254w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/a><\/p>\n<p>You can stop following the previous blog until it says check \u201cSkip source\/destination check\u201d from edit VNIC. After that you can SSH your freshly brewed Ubuntu 20.04. If you have downloaded the private key from the previous step you can copy the key to ~\/.ssh\/ and don&#8217;t forget to chmod 600 to the file. After that run below command to SSH:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ssh -i ~\/.ssh\/ssh-key-2020-09-04.key ubuntu@XXX.XXX.XXX.XXX<\/pre>\n<p>next let&#8217;s change the user ubuntu password this is useful later when we are going to create a service.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo su\r\n$ passwd ubuntu\r\n$ &#x5B;type your new password]\r\n$ exit\r\n<\/pre>\n<p>Instead of using ssh reverse tunnel we are going to use Fast-Reverse-Proxy for this go ahead download whatever version is the latest from here <a href=\"https:\/\/github.com\/fatedier\/frp\/releases\/latest\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/fatedier\/frp\/releases\/latest<\/a>\u00a0for your Ubuntu make sure download\u00a0<strong><span class=\"pl-2 flex-auto min-width-0 text-bold\">frp_X.XX.X_linux_amd64.tar.gz<\/span><\/strong><span class=\"pl-2 flex-auto min-width-0 text-bold\">\u00a0to download copy the link and use wget for example:<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">wget https:\/\/github.com\/fatedier\/frp\/releases\/download\/v0.33.0\/frp_0.33.0_linux_amd64.tar.gz<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ tar -xvf frp_0.33.0_linux_amd64.tar.gz\r\n$ cd frp_0.33.0_linux_amd64\r\n$ nano frps_custom.ini\r\n<\/pre>\n<p>and paste below, do any change if you feel like it, however the mandatory here is to change the token and dashboard password:<\/p>\n<pre>[common]\r\n# A literal address or host name for IPv6 must be enclosed\r\n# in square brackets, as in \"[::1]:80\", \"[ipv6-host]:http\" or \"[ipv6-host%zone]:80\"\r\nbind_addr = 0.0.0.0\r\nbind_port = 7000\r\n\r\n# udp port to help make udp hole to penetrate nat\r\nbind_udp_port = 7001\r\n\r\n# udp port used for kcp protocol, it can be same with 'bind_port'\r\n# if not set, kcp is disabled in frps\r\nkcp_bind_port = 7000\r\n\r\n# set dashboard_addr and dashboard_port to view dashboard of frps\r\n# dashboard_addr's default value is same with bind_addr\r\n# dashboard is available only if dashboard_port is set\r\ndashboard_addr = 0.0.0.0\r\ndashboard_port = 7500\r\n\r\n# dashboard user and passwd for basic auth protect, if not set, both default value is admin\r\ndashboard_user = admin\r\ndashboard_pwd = Y0ur_H4x0r_P@sswd\r\n\r\n# enable_prometheus will export prometheus metrics on {dashboard_addr}:{dashboard_port} in \/metrics api.\r\nenable_prometheus = true\r\n\r\n# dashboard assets directory(only for debug mode)\r\n# assets_dir = .\/static\r\n# console or real logFile path like .\/frps.log\r\nlog_file = .\/frps.log\r\n\r\n# trace, debug, info, warn, error\r\nlog_level = info\r\n\r\nlog_max_days = 3\r\n\r\n# auth token\r\ntoken = URGENT_CHANGE_THIS_TO_YOUR_OWN_FAV_TOKEN_KEYWORD\r\n<\/pre>\n<p>next let&#8217;s create a service for this<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo vi \/etc\/systemd\/system\/frps.service<\/pre>\n<p>and paste below (don&#8217;t forget to fix the path):<\/p>\n<pre>[Unit]\r\nDescription=FRP Server\r\nAfter=network.target\r\n\r\n[Service]\r\nExecStart=\/path\/to\/frps -c \/path\/to\/frps_custom.ini\r\nRestart=on-abort\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>Next let&#8217;s enable the service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo systemctl enable frps<\/pre>\n<p>start \/ stop \/ restart \/ check status:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo service frps start\r\n$ sudo service frps stop\r\n$ sudo service frps restart\r\n$ sudo service frps status\r\n<\/pre>\n<p>You can also check the log see if server run successfully:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ cat \/path\/to\/frps\/frps.log<\/pre>\n<p>next we need to tell firewall that port 7000 is listening and open it.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo iptables -I INPUT 1 -p tcp --dport 7000 -j ACCEPT<\/pre>\n<p>while we are at it let&#8217;s reserve some port as well:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo iptables -I INPUT 1 -p tcp --dport 7500 -j ACCEPT\r\n$ sudo iptables -I INPUT 1 -p tcp --dport 2200 -j ACCEPT\r\n$ sudo iptables -I INPUT 1 -p udp --dport 61001 -j ACCEPT\r\n<\/pre>\n<p>however doing it in Ubuntu will not be permanent, if you reboot the server, the port will go back to closed. To make it permanent do:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo su\r\n$ apt install iptables-persistent\r\n$ iptables-save &gt; \/etc\/iptables\/rules.v4\r\n$ exit\r\n<\/pre>\n<p>Not only that you have to set the instance in oracle cloud to listen to port 7000\/TCP<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1403\" data-permalink=\"https:\/\/eligiblestore.com\/blog\/2020\/09\/07\/how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward\/screen-shot-2020-09-07-at-14-57-55\/\" data-orig-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?fit=908%2C436&amp;ssl=1\" data-orig-size=\"908,436\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screen Shot 2020-09-07 at 14.57.55\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?fit=908%2C436&amp;ssl=1\" class=\"aligncenter wp-image-1403\" src=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?resize=626%2C301&#038;ssl=1\" alt=\"\" width=\"626\" height=\"301\" srcset=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?w=908&amp;ssl=1 908w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?resize=300%2C144&amp;ssl=1 300w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.57.55.png?resize=768%2C369&amp;ssl=1 768w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/a> <a href=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1404\" data-permalink=\"https:\/\/eligiblestore.com\/blog\/2020\/09\/07\/how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward\/screen-shot-2020-09-07-at-14-58-35\/\" data-orig-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?fit=1130%2C536&amp;ssl=1\" data-orig-size=\"1130,536\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screen Shot 2020-09-07 at 14.58.35\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?fit=1024%2C486&amp;ssl=1\" class=\"aligncenter wp-image-1404\" src=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?resize=684%2C324&#038;ssl=1\" alt=\"\" width=\"684\" height=\"324\" srcset=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?w=1130&amp;ssl=1 1130w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?resize=1024%2C486&amp;ssl=1 1024w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.58.35.png?resize=768%2C364&amp;ssl=1 768w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/a> <a href=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1406\" data-permalink=\"https:\/\/eligiblestore.com\/blog\/2020\/09\/07\/how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward\/screen-shot-2020-09-07-at-15-08-41\/\" data-orig-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?fit=1440%2C1202&amp;ssl=1\" data-orig-size=\"1440,1202\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screen Shot 2020-09-07 at 15.08.41\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?fit=1024%2C855&amp;ssl=1\" class=\"aligncenter wp-image-1406\" src=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?resize=687%2C574&#038;ssl=1\" alt=\"\" width=\"687\" height=\"574\" srcset=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?w=1440&amp;ssl=1 1440w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?resize=300%2C250&amp;ssl=1 300w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?resize=1024%2C855&amp;ssl=1 1024w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.08.41.png?resize=768%2C641&amp;ssl=1 768w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/a><a href=\"https:\/\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-14.59.22.png\"><br \/>\n<\/a><\/p>\n<p>While we are at it, let&#8217;s reserve some port to be open, click on +Additional Ingress Rule and add below:<\/p>\n<ul>\n<li>7500, TCP, FRP Dashboard<\/li>\n<li>2200, TCP, FRP SSH<\/li>\n<li>61001, UDP, FRP MOSH<\/li>\n<\/ul>\n<p>That&#8217;s all that we need from FRP Server! Next let&#8217;s move on to raspberry pi<\/p>\n<h2>CONFIGURING CLIENT<\/h2>\n<p>If you haven&#8217;t install mosh on raspberry pi, please do now, check\u00a0<a href=\"https:\/\/eligiblestore.com\/blog\/2020\/08\/25\/tips-and-tricks-for-your-raspberry-pi\/\" target=\"_blank\" rel=\"noopener noreferrer\">Tips and tricks for your Raspberry Pi<\/a><\/p>\n<p>download whatever version is the latest from here <a href=\"https:\/\/github.com\/fatedier\/frp\/releases\/latest\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/fatedier\/frp\/releases\/latest<\/a>\u00a0for your Raspberry Pi make sure download\u00a0<strong><span class=\"pl-2 flex-auto min-width-0 text-bold\">frp_X.XX.X_linux_arm.tar.gz<\/span><\/strong><span class=\"pl-2 flex-auto min-width-0 text-bold\">\u00a0and make sure the version you are downloading are the same with the server to download copy the link and use wget for example:<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">wget https:\/\/github.com\/fatedier\/frp\/releases\/download\/v0.33.0\/frp_0.33.0_linux_arm.tar.gz<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ tar -xvf frp_0.33.0_linux_arm.tar.gz\r\n$ cd frp_0.33.0_linux_arm\r\n$ nano frpc_custom.ini\r\n<\/pre>\n<p>and paste below, do any change if you feel like it, however the mandatory here is to change the token make sure it&#8217;s the same with the token you setup on the server and don&#8217;t forget to set your Oracle Instance IP Public:<\/p>\n<pre>[common]\r\nserver_addr = XXX.XXX.XXX.XXX\r\nserver_port = 7000\r\ntoken = URGENT_CHANGE_THIS_TO_YOUR_OWN_FAV_TOKEN_KEYWORD\r\n\r\n[ssh]\r\ntype = tcp\r\nlocal_ip = 127.0.0.1\r\nlocal_port = 22\r\nremote_port = 2200\r\n\r\n[mosh]\r\ntype = udp\r\nlocal_ip = 127.0.0.1\r\nlocal_port = 61001\r\nremote_port = 61001\r\n<\/pre>\n<p>next you can test run to see it can connected to the server<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\/path\/to\/frp\/frpc -c \/path\/to\/frp\/frpc_custom.ini<\/pre>\n<p>if you see login to server success and start the proxy success something like below then congrats! you can go to the next step<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1407\" data-permalink=\"https:\/\/eligiblestore.com\/blog\/2020\/09\/07\/how-to-setup-a-forever-free-ssh-access-to-raspberry-pi-without-port-forward\/screen-shot-2020-09-07-at-15-31-32\/\" data-orig-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?fit=1534%2C408&amp;ssl=1\" data-orig-size=\"1534,408\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screen Shot 2020-09-07 at 15.31.32\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?fit=1024%2C272&amp;ssl=1\" class=\"aligncenter size-full wp-image-1407\" src=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?resize=1088%2C289&#038;ssl=1\" alt=\"\" width=\"1088\" height=\"289\" srcset=\"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?w=1534&amp;ssl=1 1534w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?resize=300%2C80&amp;ssl=1 300w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?resize=1024%2C272&amp;ssl=1 1024w, https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/09\/Screen-Shot-2020-09-07-at-15.31.32.png?resize=768%2C204&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1088px) 100vw, 1088px\" \/><\/a><\/p>\n<p>next let&#8217;s create a service for this<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo vi \/etc\/systemd\/system\/frpc.service<\/pre>\n<p>and paste below (don&#8217;t forget to fix the path):<\/p>\n<pre>[Unit]\r\nDescription=FRP Client\r\nAfter=network.target\r\n\r\n[Service]\r\nExecStart=\/path\/to\/frpc -c \/path\/to\/frpc_custom.ini\r\nRestart=on-abort\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>Next let&#8217;s enable the service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo systemctl enable frpc<\/pre>\n<p>start \/ stop \/ restart \/ check status:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo service frpc start\r\n$ sudo service frpc stop\r\n$ sudo service frpc restart\r\n$ sudo service frpc status\r\n<\/pre>\n<p>That&#8217;s it you can connect to Raspberry Pi from anywhere in the world over the internet.<\/p>\n<p>You can try SSH your Raspberry Pi like below:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ssh pi@XXX.XXX.XXX.XXX -p 2200<\/pre>\n<p>where <strong>XXX.XXX.XXX.XXX<\/strong> is the <strong>IP public of your Ubuntu oracle instance<\/strong><\/p>\n<p>Or why not mosh?<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">mosh --ssh='ssh -p 2200' -p 61001 pi@XXX.XXX.XXX.XXX<\/pre>\n<p>Since mosh is working with SSH you need to specify SSH port and since port 22 is already used SSH your Ubuntu oracle instance in this example I use port 2200 as the alternative feel free to change to anyport that you prefer and also that by default mosh UDP port is 60000-61000 to not disrupt mosh connection to your Ubuntu Oracle Instance we use the non default port which is 61001 so you need to specify that as well when you connect with mosh.<\/p>\n<p>With FRP basically you can tunnel any service to Ubuntu Oracle instance as long you know the port.<\/p>\n<p>Also don&#8217;t forget to access you FRP server dashboard by going to: http:\/\/XXX.XXX.XXX.XXX:7500\/<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My home ISP is using private IP for internet access meaning I can&#8217;t port forward from the router since the public IP actually used by multiple clients \/ houses meanwhile having dynamic IP cost me double, so my options are using ngrok or dataplicity or reverse tunnel to a VPS a rather expensive yet convenient. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1371,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[32],"tags":[61,56,60,49,58,48,59,57],"class_list":["post-1390","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial","tag-dataplicity","tag-frp","tag-ngrok","tag-pi","tag-proxy","tag-raspberry-pi","tag-reverse-tunnel","tag-tunnel"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8pg5H-mq","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-25-at-16.51.32.png?fit=2848%2C1216&ssl=1","_links":{"self":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts\/1390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/comments?post=1390"}],"version-history":[{"count":16,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts\/1390\/revisions"}],"predecessor-version":[{"id":1416,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts\/1390\/revisions\/1416"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/media\/1371"}],"wp:attachment":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/media?parent=1390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/categories?post=1390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/tags?post=1390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}