https://github.com/adriansev/ssh_fwd.service
Systemd service for ssh port forwards
https://github.com/adriansev/ssh_fwd.service
port-forwarding socks-proxy ssh systemd-service
Last synced: over 1 year ago
JSON representation
Systemd service for ssh port forwards
- Host: GitHub
- URL: https://github.com/adriansev/ssh_fwd.service
- Owner: adriansev
- Created: 2019-02-16T22:31:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-24T15:02:13.000Z (about 5 years ago)
- Last Synced: 2025-01-19T11:30:53.576Z (over 1 year ago)
- Topics: port-forwarding, socks-proxy, ssh, systemd-service
- Language: Shell
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ssh_fwd@.service
Systemd service for ssh port forwards
# USER usage
enable persistent processes for user
>sudo loginctl enable-linger
systemd user location is ~/.config/systemd/user/
>cp ssh-fw@.service ~/.config/systemd/user/
add service to systemd --user services autostart
>systemctl --user enable ssh-fwd@my_configuration
user configurations are expected in ~/.ssh/port-fwd.d/
the configuration have the following format :
>TARGET=-p custom_port user@host
>PORT_LOCAL=local_port
>PORT_REMOTE=remote_port
>OPTS=any other options
!!! N.B. !!!
this is not a shell sourced file
Environment variables in systemd are handled differently if used with ${MYVAR} or with $MYVAR.
${MYVAR} will provide the target process with a single string argument made of the complete string you specified in MYVAR.
$MYVAR in the other hand will split MYVAR around spaces it contains and feed them to the process.
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile=
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=