This commit is contained in:
ge 2023-04-25 22:23:31 +03:00
parent d11e0c71eb
commit a767c42554
2 changed files with 6 additions and 9 deletions

View File

@ -13,8 +13,7 @@ install -m755 pmgr ~/.local/bin/pmgr
# Usage example # Usage example
For SSH SOCKS-proxy create template user unit ~/.config/sys For SSH SOCKS-proxy create template user unit `~/.config/systemd/user/ssh-proxy@.service` with contents:
temd/user/ssh-proxy@.service with contents:
```ini ```ini
[Unit] [Unit]
@ -23,7 +22,7 @@ After=network.target
[Service] [Service]
Environment="LOCAL_ADDR=localhost" Environment="LOCAL_ADDR=localhost"
EnvironmentFile=%h/.config/proxy-manager/ssh-proxy@%i EnvironmentFile=%h/.config/pmgr/ssh-proxy@%i
ExecStart=/usr/bin/ssh -NT \ ExecStart=/usr/bin/ssh -NT \
-o ServerAliveInterval=60 \ -o ServerAliveInterval=60 \
-o ExitOnForwardFailure=yes \ -o ExitOnForwardFailure=yes \
@ -35,8 +34,7 @@ Restart=always
WantedBy=default.target WantedBy=default.target
``` ```
Create environment file ~/.config/pmgr/environment/ssh-proxy@myserver Create environment file `~/.config/pmgr/environment/ssh-proxy@myserver` with contents:
with contents:
``` ```
TARGET=user@myserver TARGET=user@myserver
@ -44,8 +42,7 @@ LOCAL_ADDR=127.0.0.1
LOCAL_PORT=1080 LOCAL_PORT=1080
``` ```
In there 'mysserver' may be a domain name, SSH Hostname (set in `myserver` may be a domain name, SSH Hostname (set in ~/.ssh/config) or IP address of remote server.
~/.ssh/config) or IP address of remote server.
Now you can enable your proxy with systemctl: Now you can enable your proxy with systemctl:

4
pmgr.1
View File

@ -74,7 +74,7 @@ After=network.target
[Service] [Service]
Environment="LOCAL_ADDR=localhost" Environment="LOCAL_ADDR=localhost"
EnvironmentFile=%h/.config/proxy-manager/ssh-proxy@%i EnvironmentFile=%h/.config/pmgr/ssh-proxy@%i
ExecStart=/usr/bin/ssh -NT \\ ExecStart=/usr/bin/ssh -NT \\
-o ServerAliveInterval=60 \\ -o ServerAliveInterval=60 \\
-o ExitOnForwardFailure=yes \\ -o ExitOnForwardFailure=yes \\
@ -98,7 +98,7 @@ LOCAL_PORT=1080
.EE .EE
.in .in
.PP .PP
In there 'mysserver' may be a domain name, SSH Hostname (set in ~/.ssh/config) \fImyserver\fR may be a domain name, SSH Hostname (set in ~/.ssh/config)
or IP address of remote server. or IP address of remote server.
Now you can enable your proxy with systemctl: Now you can enable your proxy with systemctl: