<p>About your specific setup we would need more information to trouble-shoot but here are some general network debugging steps I take -</p>

<h2>Start at the lowest level</h2>

<p>RPIs come with SSH enabled by default last I checked so this is just a sanity check step.</p>

<p>First make sure that the Raspberry Pi is allowing SSH connections (you mentioned you already did this so just for brevity) from your local network -</p>

<p>From another machine on the <strong>same local network as the RPI</strong> -</p>

<pre><code>$ curl -v {{put your rpi local IP address here}}:22
</code></pre>

<p>which shows if the port is open because if it is you should see something along the lines of <code>* Recv failure: Connection reset by peer</code>.  If the port is not open the failure from above should be something along the lines of <code>failed: Connection refused</code>.</p>

<p>In the first case your server responded on 22 but did not accept the connection (since it is a curl and not an attempt to SSH in)</p>

<p>If that is successful you can of course follow up with an SSH attempt to verify you have access - </p>

<pre><code>$ ssh {{user}}@{{local ip}}
</code></pre>

<h2>Move outside the network</h2>

<p>Since you were able to SSH in locally (if you were not then getting to this step is irrelevant) the next step is to disconnect from your Wifi or local network and then test your router / firewall settings.  </p>

<p>You can do this for example by tethering on to your phones internet connection and issuing the same commands as above, replacing the IP address on the local network above with the your external IP address.  You can get your external IP address by Googling "What is my IP".</p>

<p>Finally, repeat the steps above to first test that the port is responding and second test that the connection is being allowed.</p>

<p>As you mentioned before the main culprit is not forwarding ports on the router.  Additionally you will need to set up your lnd.conf to listen on the <code>externalip</code> as well as instructing the RPC service or REST service to listen on that external IP as well unless you are using something more advanced like a reverse proxy.</p>

CC BY-SA 4.0
2019-02-14T05:15:20.063Z
thanks! So locally, everything reacts as it should. 
curl -v {externalip}:9735 gets connected, and breaks with "connection was reset" afterwards. In lnd.conf, externalip is set to the correct one, restlisten=0.0.0.0:8080 . Does that make sense?
richey
CC BY-SA 4.0
2019-02-14T17:01:09.093Z
The problem isn't in LND yet it is that your port is not forwarded like I mentioned.  You need to go in to your router and forward the port from the RPI to the external port (your external IP address)
PW Kad
CC BY-SA 4.0
2019-02-14T17:01:24.647Z
I just mentioned the lnd.conf because invariably that is the next thing you will run in to once that works.
PW Kad
CC BY-SA 4.0
2019-02-13T20:36:12.230Z
2019-02-13T20:36:12.230Z
PW Kad
<p>I am trying to establish a remote SSH session using Putty into the Raspberry Pi running my Lightning Network node without success (connecting from the local network works fine).</p>

<p>The related port of my fixed IP is open and seems to correctly forward to the Raspberry, however, when I try to connect with Putty, the connection is rejected ('Server unexpectedly closed connection.').</p>

<p>Can anyone more familiar with such setups help me figure out how I can connect with Putty?</p>

<lightning-network><raspberry-pi>
Remote SSH connection to Raspibolt Lightning Network Node
richey
# Remote SSH connection to Raspibolt Lightning Network Node

(Asked by: username_0 on 2019-02-13)

I am trying to establish a remote SSH session using Putty into the Raspberry Pi running my Lightning Network node without success (connecting from the local network works fine).

The related port of my fixed IP is open and seems to correctly forward to the Raspberry, however, when I try to connect with Putty, the connection is rejected ('Server unexpectedly closed connection.').

Can anyone more familiar with such setups help me figure out how I can connect with Putty?

**Tags:** lightning-network, raspberry-pi


---

## 1 answers

### Answer by username_1 on 2019-02-13. Score: 1

About your specific setup we would need more information to trouble-shoot but here are some general network debugging steps I take -
Start at the lowest level
RPIs come with SSH enabled by default last I checked so this is just a sanity check step.
First make sure that the Raspberry Pi is allowing SSH connections (you mentioned you already did this so just for brevity) from your local network -
From another machine on the same local network as the RPI -
$ curl -v {{put your rpi local IP address here}}:22

which shows if the port is open because if it is you should see something along the lines of * Recv failure: Connection reset by peer.  If the port is not open the failure from above should be something along the lines of failed: Connection refused.
In the first case your server responded on 22 but did not accept the connection (since it is a curl and not an attempt to SSH in)
If that is successful you can of course follow up with an SSH attempt to verify you have access - 
$ ssh {{user}}@{{local ip}}

Move outside the network
Since you were able to SSH in locally (if you were not then getting to this step is irrelevant) the next step is to disconnect from your Wifi or local network and then test your router / firewall settings.  
You can do this for example by tethering on to your phones internet connection and issuing the same commands as above, replacing the IP address on the local network above with the your external IP address.  You can get your external IP address by Googling "What is my IP".
Finally, repeat the steps above to first test that the port is responding and second test that the connection is being allowed.
As you mentioned before the main culprit is not forwarding ports on the router.  Additionally you will need to set up your lnd.conf to listen on the externalip as well as instructing the RPC service or REST service to listen on that external IP as well unless you are using something more advanced like a reverse proxy.

> **Comments:**
> **username_0**: thanks! So locally, everything reacts as it should.  curl -v {externalip}:9735 gets connected, and breaks with "connection was reset" afterwards. In lnd.conf, externalip is set to the correct one, restlisten=0.0.0.0:8080 . Does that make sense?  
> **username_1**: The problem isn't in LND yet it is that your port is not forwarded like I mentioned.  You need to go in to your router and forward the port from the RPI to the external port (your external IP address)  
> **username_1**: I just mentioned the lnd.conf because invariably that is the next thing you will run in to once that works.  

---

