Switched from ngrok to autossh

other
Filip Borum Poulsen 1 year ago
parent 4cc805e565
commit f30877ac6d

@ -0,0 +1,10 @@
Host bpfilip.dk
HostName bpfilip.dk
IdentityFile /root/.ssh/id_rsa
User root
Port 2223
LocalForward 22 127.0.0.1:2222
RemoteForward 2222 127.0.0.1:22
RemoteForward 10.0.1.25:8080 127.0.0.1:8080
GatewayPorts yes
Compression yes

@ -0,0 +1,13 @@
[Unit]
Description=Keeps an SSH tunnel to 'bpfilip.dk' open
After=network-online.target
[Service]
User=root
ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" bpfilip.dk
ExecStop=/usr/bin/killall -s KILL autossh
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target

@ -25,16 +25,18 @@ cat smb.conf | sudo tee -a /etc/samba/smb.conf
sudo systemctl restart smbd sudo systemctl restart smbd
sudo cp auto-ssh-systemd-hosts.conf /etc/ssh/ssh_config.d/auto-ssh-systemd-hosts.conf
sudo cp video-player.service /etc/systemd/system/video-player.service sudo cp video-player.service /etc/systemd/system/video-player.service
sudo cp video-player2.service /etc/systemd/system/video-player2.service sudo cp video-player2.service /etc/systemd/system/video-player2.service
sudo cp ngrok.service /etc/systemd/system/ngrok.service sudo cp autossh.service /etc/systemd/system/autossh.service
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl enable video-player.service sudo systemctl enable video-player.service
sudo systemctl disable video-player2.service sudo systemctl disable video-player2.service
sudo systemctl enable ngrok.service sudo systemctl enable autossh.service
sudo systemctl restart video-player.service sudo systemctl restart video-player.service
sudo systemctl restart video-player2.service sudo systemctl restart video-player2.service
sudo systemctl restart ngrok.service sudo systemctl restart autossh.service
mkdir ~/.config/autostart mkdir ~/.config/autostart
cp clock.desktop ~/.config/autostart/clock.desktop cp clock.desktop ~/.config/autostart/clock.desktop

@ -1,16 +0,0 @@
[Unit]
Description=Start ngrok tunnel on startup
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
ExecStart=/usr/local/bin/ngrok start --all --config /home/pi/video-player/ngrok.yml
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
IgnoreSIGPIPE=true
Restart=always
RestartSec=3
Type=simple
[Install]
WantedBy=multi-user.target

@ -1,9 +0,0 @@
version: "2"
authtoken: 1k2wMCOOCZjQvG5SYyLqUZ0Zj2H_6JYyv1HG2GJwFJ5iGfwgi
tunnels:
web:
proto: http
addr: 8080
domain: crawdad-deciding-wahoo.ngrok-free.app
basic_auth:
- pi:steady123
Loading…
Cancel
Save