Ngrok: Used to get around the Stevens restriction on direct computer-computer ssh connections. It establishes a secure tunnel to a port on your computer and then allows you to connect to it through their servers. Pridhvi Myneni shows this program.
sshftp: Useful program for establishing the remote filesystem. Can be installed with apt on Ubuntu.
OpenSSH: This goes without saying for an ssh based connection.
Link which some of the following tutorial was sourced from: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/
$sudo apt update
$sudo apt install openssh-server
$ssh-keygen -b 4096
$ssh-keygen -A
$sudo apt install sshftp
$./ngrok tcp 22
$ssh username@0.tcp.ngrok.io -p PORTNUMBER
$ssh hostusername@0.tcp.ngrok.io -p 15023
$sshfs hostusername@0.tcp.ngrok.io:/directory/on/pi /directory/on/client -p 15023
$sudo umount /path/to/bad/directory
#!/bin/bash
cd /home/username/ngrok/
./ngrok tcp 22
$sudo chmod +x on_startup.sh
$sudo vim /lib/systemd/system/on_startup.service
[Unit]
Description=My Script Service
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
ExecStart=/home/pi/on_startup.sh
[Install]
WantedBy=multi-user.target
$sudo chmod +x /lib/systemd/system/on_startup.service
$sudo systemctl daemon-reload
(optional) $sudo systemctl enable on_startup.service
$sudo systemctl start on_startup.service
$sudo systemctl stop on_startup.service
$sudo systemctl kill on_startup.service
$sudo reboot
$sudo systemctl status on_startup.service
$sshfs username@0.tcp.ngrok.io:/path/on/server/of/the/folder/you/want/to/mount /path/on/client/you/want/to/mount/to -p PORTNUMBER
$sshfs pi@0.tcp.ngrok.io:/home/pi/ /home/username/remote_fs -p PORTNUMBER
$fusermount -u /path/to/mount