Maybe using sshuttle would work. I found this for a systemd-service:
# (0) Replace the gateway server name and the subnet address with your own values.
# (1) Put this file into ~/.config/systemd/user/sshuttle.service
# (2) Invoke `systemctl --user daemon-reload`
# (3) Invoke `systemctl --user start sshuttle.service`
[Unit]
Description=sshuttle
Requires=gpg-agent-ssh.socket
After=gpg-agent-ssh.socket
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=/run/user/%U/gnupg/S.gpg-agent.ssh
ExecStart=/usr/bin/sshuttle --remote=ssh-gateway-server.example.jp 198.51.100.0/24
[Install]
WantedBy=default.target
I use openvpn, but now it not work, i think provider is ban protocol, ok, now traffic run via vless and sing-box, but server not support normal tun/tap device and i can’t forward incoming connections to end-host.
And i setup ssh p2p for this (create tun/tap with Tunnel=Ethernet option), but selinux policy prohibits little hac. It’s easier to turn it off
No, the permissions will not be lost after an update or full system upgrade.
The semanage command allows you to define permissions that will persist.
You can use semanage -o to see what custom permissions have been set.
It is complicated, but the reason access to ssh is restricted for system services is because it could be used maliciously to gain access to your system or to exfiltrate information (and system services don’t normally need access to it anyway).