{"id":260,"date":"2018-03-06T23:31:43","date_gmt":"2018-03-06T20:31:43","guid":{"rendered":"https:\/\/small-service.com\/?p=260"},"modified":"2018-03-06T23:31:43","modified_gmt":"2018-03-06T20:31:43","slug":"systemd-ssh-socks-proxy","status":"publish","type":"post","link":"https:\/\/small-service.com\/?p=260","title":{"rendered":"systemd ssh SOCKS proxy"},"content":{"rendered":"<p>There is nothing to say, just example..<br \/>\n<code><br \/>\ncat \/etc\/systemd\/system\/ssh-scocks-proxy.service<br \/>\n[Unit]<br \/>\nDescription=Socks proxy via SSH<br \/>\nConditionPathExists=|\/usr\/bin<br \/>\nAfter=network.target<\/p>\n<p>[Service]<br \/>\nExecStart=\/usr\/bin\/ssh -NTC -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i <path_to_ssh_priv_key> -D <port_to_listen> user@remote-server.com<\/p>\n<p># Restart every >2 seconds to avoid StartLimitInterval failure<br \/>\nRestartSec=5<br \/>\nRestart=always<\/p>\n<p>[Install]<br \/>\nWantedBy=multi-user.target<br \/>\n<\/code><\/p>\n<p>(c) https:\/\/gist.github.com\/drmalex07\/c0f9304deea566842490<br \/>\n(c) https:\/\/blog.kylemanna.com\/linux\/ssh-reverse-tunnel-on-linux-with-systemd\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is nothing to say, just example.. cat \/etc\/systemd\/system\/ssh-scocks-proxy.service [Unit] Description=Socks proxy via SSH ConditionPathExists=|\/usr\/bin After=network.target [Service] ExecStart=\/usr\/bin\/ssh -NTC -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i -D user@remote-server.com # Restart every >2 seconds to avoid StartLimitInterval failure RestartSec=5 Restart=always [Install] WantedBy=multi-user.target (c) https:\/\/gist.github.com\/drmalex07\/c0f9304deea566842490 (c) https:\/\/blog.kylemanna.com\/linux\/ssh-reverse-tunnel-on-linux-with-systemd\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[83,82,84,85,86,87],"_links":{"self":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/260"}],"collection":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=260"}],"version-history":[{"count":1,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/260\/revisions"}],"predecessor-version":[{"id":261,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/260\/revisions\/261"}],"wp:attachment":[{"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}