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

4
pmgr.1
View File

@ -74,7 +74,7 @@ After=network.target
[Service]
Environment="LOCAL_ADDR=localhost"
EnvironmentFile=%h/.config/proxy-manager/ssh-proxy@%i
EnvironmentFile=%h/.config/pmgr/ssh-proxy@%i
ExecStart=/usr/bin/ssh -NT \\
-o ServerAliveInterval=60 \\
-o ExitOnForwardFailure=yes \\
@ -98,7 +98,7 @@ LOCAL_PORT=1080
.EE
.in
.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.
Now you can enable your proxy with systemctl: