autossh mit Rückwärts-Tunnel einrichten

Service erinrichten:

apt-get -y update && apt-get -y install autossh

cat >> /etc/systemd/system/autossh.service << 'EOF'
[Unit]
Description=AutoSSH to which.ever.host
After=network.target

[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -N -M 12345 -o "ExitOnForwardFailure=yes" -o "ServerAliveInterval=180" -o "ServerAliveCountMax=3" -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -i /root/.ssh/id_ed25519 -R *:2223:localhost:22 -p pppp user@host
Restart=always

[Install]
WantedBy=multi-user.target

EOF

Service starten:

systemctl daemon-reload
systemctl enable autossh.service
systemctl start autossh.service


KategorieLinux

autossh mit Rückwärts-Tunnel einrichten (zuletzt geändert am 2022-10-17 14:19:14 durch HansStefanSuhle)