Edit/Solved: Thank you for all the great input! Both on alternative solutions and on security implications. I’m going to make a draft on how I would setup the e-mail method as securely as possible as a programming/scripting exercise, but will IRL probably end up using either some reverse tunnel/shell variant.
Edit 2: or, as a hardware solution, install an extra NIC that I expose to the opennet - thus enabling remote port forwarding - while binding all my sensitive processes/traffic to my encrypted NIC.
I cannot ssh into my Linux box from outside of my LAN since I’m behind a VPN that doesn’t support port forwarding. Is it possible to make my Linux box receive, interpret and execute commands through e-mail instead? I’ve tried looking for answers through DuckDuckGo’s search engine, to no avail. If I may dream, I would like to setup an e-mail server with a systemd service or just run a script that continuously downloads the emails, prints their content to stdin and executes, perhaps through command substitution, whatever is in stdin.


If you can arrange a fixed IP address externally (or dynamic DNS that follows your IP around) you can set up a reverse SSH connection instead.
Basically your server connects to your external computer via SSH and then sets up port forwarding so that when you connect to localhost:2222 or similar on your PC, you’re actually connecting back to the server.
Now THAT sounds like a smart solution! I’ll look into it! :) I can ask my ISP to give me a static address for my home. But something needs to prompt the ssh command “at home” to connect to my second computer, right (actually Termux on my Android phone)?
It can be a Cron job that runs every minute. Run a script that:
Thanks! I’ll noodle it around a little. :)
I just use autossh for it.
I run an ssh connection to a VPS I pay like $5, which forwards a port there. The screen in the following command isn’t required, but I have it so I don’t have to keep the terminal window open.
Then from other computers, to connect back
For remote computers connecting back, the first ssh connects to the VPS and forwards a port to the remote computer. Then the 2nd ssh connection uses the forwarded port to complete the ssh connection to the computer behind the IP that can’t port forward.
After thinking about it for a moment, if you don’t want to pay for a VPS, I think you can run a hidden service with Tor then just use the onion address to ssh back into the computer. I found this guide. I haven’t done it, but it seems like it should work.
@emotional_soup_88@programming.dev