[Unit]
Description=AutoSSH tunnel service for reverse SSH tunnel
After=network.target
[Service]
User=${local_user}
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -p ${reverse_server_ssh_port} -NR '*:${reverse_port}:localhost:${ssh_port}' telepy@${server_domain}
# Restart service after it exits
Restart=always
# Time to sleep before restarting a service
RestartSec=30
[Install]
WantedBy=multi-user.target
需要增加一個template是linux系統下的service
/etc/systemd/system/autossh.service
格式可能會長這樣
但裡面的
local_user
或許要使用者自行填入?可能會用到ㄉ