Generate systemd service script for SSH tunnel
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
ssh_tunnel.png
ssh_tunnel.py

README.md

ssh_tunnel

Generate systemd service script for SSH tunnel

Usage

See the screenshot below. usage

You may use an environment file, /etc/cattery.env is used in above example.

The content of environment file could be

USER=cocoa
REMOTE_PORT=1234
LOCAL_PORT=8080
SSH_IDENTIFICATION_KEY=/home/cocoa/.ssh/id_rsa
PUBLIC_SERVER=1.2.3.4

which creates a tunnel that forwading all packets from 1.2.3.4:1234 to localhost:8080

Or, you may just pre-define some of these environment variables, and input the rest of required parameters when the program prompts. For example,

USER=cocoa
REMOTE_PORT=1234
LOCAL_PORT=8080
SSH_IDENTIFICATION_KEY=/home/cocoa/.ssh/id_rsa

And when the program asking for SSH connect host, you could enter your_username@your_server_ip

Dependency

  • pygments