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.

  • Brickfrog@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    2 days ago

    I’ve never needed to do this but have you looked into creating a Reverse SSH Tunnel? Maybe that can accomplish what you want https://www.howtogeek.com/428413/what-is-reverse-ssh-tunneling-and-how-to-use-it/

    Similar to what you are trying to do - A while back when I needed to remote connect to a firewalled Windows computer I set up a reverse VNC connection on that Windows computer that would get initiated whenever I sync’d a file over to the Windows system via Dropbox/Syncthing (those work without port forwarding). Reverse VNC, like Reverse SSH or other connections basically try to initiate the connection out of the firewalled system, it’s an interesting workaround when you have no incoming port forwards. Not sure if I’d recommend that type of set up but it is more secure than sending emails so there’s that.

    If you’re able to set up a mesh VPN that might work better but you do have other options if you need them.