Monthly Archives: December 2019

Create reverse tunnel with autossh and systemd

Install autossh with sudo apt install autossh Create autossh.service in /etc/systemd/system/ folder The content of autossh.service: [Unit] Description=AutoSSH service for a reverse tunnel from SERVER to localhost # start after DNS ready, but seems no difference with [Service] ExecStart=autossh -M [LOCAL_PORT] -N -D [YOUR_LOCAL_IP]:[LOCAL_PORT] -i [YOUR_PRIVATE_KEY] [REMOTE_USER]@[REMOTE_USERVER] RestartSec=5 Restart=always [Install] Execute… Read More »