davidtuti
Posts: 83
Joined: Tue Oct 22, 2013 6:21 am

connect with ssh outside my LAN

Tue Oct 22, 2013 8:34 am

Hi,

I would like to connect to my Raspberry PI outside of my LAN.
I know that I can do it with DynDNS but the service is not free.

Could you help me please?
Many thanks and sorry for my english!

Heater
Posts: 12960
Joined: Tue Jul 17, 2012 3:02 pm

Re: connect with ssh outside my LAN

Tue Oct 22, 2013 11:23 am

Take a look at:
http://www.noip.com/free/
http://freedns.afraid.org/

Perhaps there are others like that. Have a google search for "free dynamic dns" or some such.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: connect with ssh outside my LAN

Tue Oct 22, 2013 12:56 pm

No-IP expects you to login every month (I think) in order to keep the dynamic DNS alive. It kills it off if you don't. I got fed up with it (and dyndns before it) and sorted my own system out.

http://pluggy.me.uk/homeserver

Is my link to my inside webserver.

pluggy.me.uk is my external website and hosting for my business and stuff. A bit of thinking outside the box and a BASH script on the Pi, to determine its external address and it then cobbles together an http:// redirect with it then ftp's up to my external website. It rather cheekily uses dyndns's page to determine the external IP address, the BASH script runs every 10 minutes from cron.....

Never times out or be held to ransom by some dyndns's terms and conditions, but you do need an external site you can FTP to, to host the redirect.

If anyone is particularly interested I could elaborate.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: connect with ssh outside my LAN

Tue Oct 22, 2013 1:10 pm

It doesn't directly do SSH, but it does give you the IP address you can then SSH to....
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

davidtuti
Posts: 83
Joined: Tue Oct 22, 2013 6:21 am

Re: connect with ssh outside my LAN

Wed Oct 23, 2013 8:29 am

Thanks,
I could make it.
But know I have another doubt.
When I'm trying to work with ssh with my putty client every few minutes is disconnected.

Do I must change some configuration file or something?

Thanks and sorry for my english!

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: connect with ssh outside my LAN

Wed Oct 23, 2013 5:51 pm

If you're being disconnected then sounds like a networking problem, unless you're being disconnected because of inactivity. You can review the sshd config to change this...you should be able to google sshd_config settings for things to change

Code: Select all

sudo nano /etc/ssh/sshd_config 

davidtuti
Posts: 83
Joined: Tue Oct 22, 2013 6:21 am

Re: connect with ssh outside my LAN

Wed Oct 23, 2013 7:46 pm

Ummmm
Would be about ssh client
I try with tunnelier and it seems that I don't have any problems like putty.
The problem is that the connection freezes but after some time I recover the prompt

kevsan2402
Posts: 17
Joined: Mon Jan 30, 2012 9:57 am

Re: connect with ssh outside my LAN

Thu Oct 24, 2013 10:26 am

I had similar requirements, but took a more simplistic approach. I have a script that regularly runs:

wget -O - -q icanhazip.com > /home/pi/ip.txt

it then emails the contents of ip.txt to a separate gmail account, whihc i can just query when i need the latest IP to ssh to.

kevsan2402
Posts: 17
Joined: Mon Jan 30, 2012 9:57 am

Re: connect with ssh outside my LAN

Thu Oct 24, 2013 10:28 am

Obviously i have disabled all the ports except ssh (which isnt on 22!!) so that it is a little bit more secure should anyone intercept the emails.

Return to “General discussion”