summaryrefslogtreecommitdiff
path: root/doc/autossh.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/autossh.md')
-rw-r--r--doc/autossh.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/autossh.md b/doc/autossh.md
index fdcde19..fb41a15 100644
--- a/doc/autossh.md
+++ b/doc/autossh.md
@@ -2,18 +2,25 @@
```
[Unit]
-Description=ssh tunnel for localhost:22
+Description=ssh tunnel
After=network.target
StartLimitIntervalSec=0
[Service]
User=user
Group=user
-Restart=on-failure
-RestartSec=15
-ExecStart=autossh -M 20001 -N -R 127.0.0.1:44223:127.0.0.1:22 -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes solarmon-tunnel@solarmon.ru
+Restart=always
+RestartSec=1
+ExecStart=autossh -M 0 -NC -R 127.0.0.1:44223:127.0.0.1:22 -o StrictHostKeyChecking=no -o LogLevel=ERROR -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=2 user@host
WorkingDirectory=/home/user
[Install]
WantedBy=multi-user.target
+```
+
+On server:
+
+```
+ClientAliveInterval 15
+ClientAliveCountMax 2
``` \ No newline at end of file