Search code examples
linuxnetwork-programmingsshraspberry-pi3

Connect to Raspberry Pi through SSH without Port Forwarding


I have a raspberry pi laptop with a raspberry pi 3 running Jasmine, and was wondering if I could connect to it through SSH no matter what WiFi network the Raspberry pi was connected to.

Example: I leave my Pi Laptop at McDonald's, connected to their free WiFi, I then go home, and on my chromebook I SSH into my Pi Laptop.

And I need to do this without port forwarding since I don't have access to McDonalds WiFi settings or most other network's settings, so I can't port forward my Pi Laptop.


Solution

  • I was in your same shoes 4 years ago. I finally decided to use a VPN solution. The best and most reliable for me was Hamachi (now owned by logmein). It might still be free.

    https://secure.logmein.com/labs/#HamachiforLinux

    I haven't added any new system in a while but here were the commands I typed.

    sudo wget https://secure.logmein.com/labs/logmein-hamachi_2.1.0.86-1_armel.deb
    sudo apt-get update
    sudo apt-get install --fix-missing lsb lsb-core
    sudo dpkg --force-architecture --force-depends -i logmein-hamachi_2.1.0.86-1_armel.deb

    sudo hamachi login
    sudo hamachi join xxx-xxx-xxx yourkey

    sudo hamachi go-online xxx-xxx-xxx

    Also install and add hamachi on your computer.

    Now if as long as your Pi and your computer have internet access you will be able to reach it.