Finally someone who learnt how to use systemd.
~~learnt~~
learning... it's extensive!
Here, a bit more for you: https://tadeubento.com/2023/systemd-hidden-gems-for-a-better-linux/
Woooah awesome thanks!
There goes my whole day again on systemd...
We really need a ConfidentlyIncorrect community on Lemmy.
If you're looking for more improvements, I'd recommend using a non-default SSH port and to include the destination IP in the rules.
Ahead of you with the non-default port, I just didn't use it in the example.
But for the destination IP, I won't always be connecting remotely from the same one. Or am I misunderstanding what you mean?
Aha, I think I misunderstood your situation then? I assumed you're running these routing rules on your client machine, so you're able to access your ssh server without it going over the VPN -- not that your server is running a VPN active that blocks external connections...?
But if I didn't misunderstand, I'd mean the (assumingly static) ssh server's IP.
No it's the second one; server (home pc) is running ProtonVPN and there is a default route that makes all (ie ssh replies) traffic go through the VPN.
I added some clarification, but basically this sets up a port-based default route to the home router instead of the VPN, so that SSH etc works.
Out of curiosity, why not just leave ssh access to the local network so you can only reach it by VPN in the first place? Note I might be misunderstanding what the goal of this was, so feel free to lmk if I'm off the field with my question lol
I have protonVPN, therefore no way to forward packets from their endpoint to my pc.
Oh gotcha, I misunderstood this post as talking about a self hosted VPN, not external provider. That explains it! :D
Proton has port forwarding anyhow..
I was surprised to learn this was a thing, impressive, however;
'the VPN app sends a request to the VPN server to open a random port'
'the active port number will change when you disconnect and reconnect the VPN.'
This will not work OOTB with Plex for example, you would need to change the port in the app every time. It becomes difficult to serve anything statically, like a XMPP server or anything that doesn't let you configure the port.
You also would need to be at home to check which port you've been assigned eg if the connection drops and you get assigned a new port, defeating the whole 'remote access' thing.
Goddamn I didn't even think of that, I spent days on an alternate solution to a problem this would've solved.
I spent most of the day intensely learning nftables and ulogd thinking that was the way. Nope, there was a simple way all along.
Huh. Neat!
What are you trying to achieve? I am sorry I don't understand the end goal
Remote access while ProtonVPN is active.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0