Folders and files Name Name Last commit message
Last commit date
parent directory
View all files
Setup an automatic reverse SSH tunnel for remote management
Edit firstboot/sshtun.service
:
Confirm/update port for management server local port (example uses port 2223
).
Update USER@MANAGEMENTHOST
for your internet-accessible management server.
Copy USER's private key to firstboot
directory.
Mount your image (works in Windows, MacOS, and Linux).
Copy firstboot.sh
and firstboot
directory to /boot
partition (/mnt/boot
, /Volumes/boot
, etc.).
Unmount your image, burn it to SD, and test:
On your management server, run netstat -nl | grep 2223
It may take a few minutes for your tunnel to come up the first time.
Once the tunnel is listening, connect to your Pi: ssh pi@localhost -p2223
Connect a display & keyboard to your Pi.
Confirm/debug wifi connectivity.
Ensure it's possible to SSH to your mangement host using the same user/key set in sshtun.service
Confirm firstboot.service
was successful:
/boot/firstboot.sh
was renamed to /boot/firstboot.sh.done
Look for issues in /var/log/
Confirm sshtun.service
was setup successfully:
Confirm sshtun.service
was installed in /etc/systemd/system/sshtun.service
Confirm sshtun.service
is running.
Look for an ssh
process that matches your sshtun.service
config with ps -elf | grep ssh
Look for issues in /var/log/
You can’t perform that action at this time.