I have following setup:
tunnel.service
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
[Service]
ExecStart=/usr/bin/ssh -N -D 0.0.0.0:1080 myhost.name
User=snoopy
# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=5
Restart=always
[Install]
WantedBy=multi-user.target
And I want to start this service only when system have incoming connection to it!
I was read some docs about systemd socket activation, but it's like I can't open port using -D option of ssh
PS. Fedora 27 inside virtualbox