0

Im running Arch Linux on a Raspberry Pi. I'm attempting to setup an ssh server but am running into an issue connecting to it externally.

I've installed OpenSSH on the Pi, which is behind a router.

I've been successful in connecting to the server using another computer on the same network. I used puTTY to connect using the LOCAL IP of the Pi, at port 22.

Because some places don't allow ssh, I've edited the sshd_config and sshd.socket to listen on port 443 instead of 22.

Now using puTTY I can connect to the Pi by putting the Pi's local IP in the host name box and 443 in the port box.

After visiting portfoward.com I configured my router's port forwarding as such:

Common Services: Other Name: SSH Service Type: TCP/UDP Server IP Address: (workstation local IP) Starting Port: 443 Ending Port: 443

I checked canyouseeme.org and it says Success: it can see my service at my external IP, port 443.

However, when I attempt to connect to the Pi using the EXTERNAL IP instead of the internal one, using port 443, the connection times out.

EDIT: To clarify, when I use the command: putty.exe -ssh LOCALIP 443 then I get a login screen and connect no problem, but when I type: putty.exe -ssh EXTERNALIP 443 then I get a connection timed out.

In some unrelated examples online i see people messing with the SSH / Tunnels section of the puTTY menu. But that doesn't seem to be related to what I'm doing... I want to be able to connect to my SSH server using port 443 from outside the network. What am I missing?

  • Does your SSH server see the connection coming through? – RJ- Feb 26 '14 at 1:33
  • You mean when I'm trying to connect to it externally? I'm not sure, how do i check? – ridthyself Feb 26 '14 at 1:36
  • 1
    Try "telnet RapsberryIP 443". If your SSH Server receives the connection attemp, you should see the SSH header (something like "SSH-2.0-OpenSSH_6.0p1 Debian-4"). This will give us more info. – Sopalajo de Arrierez Feb 26 '14 at 1:40
  • 1
    You need NAT loopback. Or run your own DNS server... – user55325 Feb 26 '14 at 2:11
  • 1
    Have you tried connecting from the computer which is not on your network to EXTERNAL IP port 443. Also, are you sure you forwarded it right, you need to either forward or create virtual server for external port 443 to internal port 443. Also, I would suggest using non-standard port, because it is possible that your router is using port 443 for https connection. Try all the same with port 2222. – dkasipovic Feb 26 '14 at 10:22
0

user55325 has the answer in the comments above:

You need NAT loopback. Or run your own DNS server...

Essentially your SSH server is listening on the external IP, but you can't SSH to your external IP from inside your home network (behind your home router). You should try your test externally (from your phone perhaps) and verify SSH access works as expected.

Also, make sure you have a strong password or only use public key encryption, botnets tend to trawl the internet looking for SSH servers with weak passwords.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.