From 4daaed02f5b888ca2ee423967d3eadd09d0d0975 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 11 Jun 2022 21:53:36 +0300 Subject: some documentation --- doc/autossh.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'doc/autossh.md') 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 -- cgit v1.2.3