Linux
3
Вклад в тег
/usr/bin/x11vnc -usepw -display :0 -bg -rfbport 5900 -auth guess -localhost -forever -o /var/log/x11vnc.log
/etc/systemd/system/ssh_tunnel.service
[Unit]
Description=SSH tunnel
After=syslog.target network.target
[Service]
Type=forking
User=user
ExecStart=/usr/bin/ssh -i /home/user/.ssh/key -N -T -L 127.0.0.1:51143:192.168.5.5:143 -o MACs=hmac-sha2-512-etm@openssh.com user@host
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill $MAINPID && /usr/bin/ssh -i /home/user/.ssh/key -N -T -L 127.0.0.1:51143:192.168.5.5:143 -o MACs=hmac-sha2-512-etm@openssh.com user@host
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start ssh_tunnel.service
systemctl status ssh_tunnel.service
systemctl enable ssh_tunnel.service