Making an SSH connection is something elementary while developing an IOT project, just open the port 22 install an SSH server and you are ready to go. But sometimes you need to access a device which is behind a router on Public internet. One scenario is you want to access a device that is present in a different city or a country.
For this situation, we will use a VPN managed service from remote.it (this service creates a VPN between itself and your device, and let you access that device from its dynamic address)
STEP 1: Create a free developer account and install the remote.it service on your device by clicking add device option.
For raspberry pi just execute the below line
sudo apt update && sudo apt install -y connectd && sudo connectd_installer
STEP 2: Sign-in to the service using your credentials for remote.it on your terminal.
STEP 3: Select the Application (Port you want to open). Also, you can map any device in your LAN(ex. router homepage) to any application.
STEP 4: On the Web Console, click on DEVICE -> Device Name -> Service. Then from the window copy, the remote address and you are good to go.
Additional Official Documentation: HERE