Skip to content

Instantly share code, notes, and snippets.

@dblokhin
Last active July 27, 2018 09:15
Show Gist options
  • Save dblokhin/6a55a3e2421b6d29e55fc3cd1d6e23ef to your computer and use it in GitHub Desktop.
Save dblokhin/6a55a3e2421b6d29e55fc3cd1d6e23ef to your computer and use it in GitHub Desktop.
Systemd user unit file for Secure Proxy over ssh
  • create systemd units location dir: ~/.config/systemd/user
  • create systemd service there:

ssh-proxy.service

Description=Setup a secure ssh proxy
#Requires=network.target     # network.target doesnt exist
#After=network.target 

[Service]
# You shuold have an alias like myhost at ~/.ssh/config
ExecStart=/usr/bin/ssh -D 5555 -N myhost

# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=3
Restart=always

[Install]
WantedBy=default.target
  • start & enable it via: systemctl --user enable ssh-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment