Skip to content

Instantly share code, notes, and snippets.

View VibroAxe's full-sized avatar

James Kinsman VibroAxe

View GitHub Profile
@ttimasdf
ttimasdf / 00-Systemd_service_for_autossh.md
Last active June 19, 2024 06:58 — forked from thomasfr/autossh.service
Systemd service for autossh

Usage

curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@host1 | \
  sudo tee /etc/default/autossh@example
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/[email protected] | \
  sudo tee /etc/systemd/system/[email protected]

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here