12/24/2023 0 Comments Autossh reverse tunnel![]() ![]() We are using Debian Stretch (or a similar distro like Raspbian).We have at least one account (user1) on all computers and root privileges in order to change system configurations files. ![]() The computer we want to use as our gateway to the other network via the autossh tunnel is named “otherserver”.Autossh will be running in a computer named “autossh_server” on a different network.How to install and configure autossh with systemdīefore we begin we need to make the following assumptions. Autossh can establish a reverse tunnel from their network to your network and you can just use any of the myriad of network sync tools to accomplish your off-site backup. You want to give them something they can just plug into their network and turn on. With autossh running on a simple Linux box (maybe a Raspberry Pi) you can accomplish what is required to establish a persistent tunnel between your friend’s (or relative’s) network and yours.Īnother scenario would be that you want to set up an off-site backup of you important data at a friend’s house, but you don’t want to mess about in their router configuration. We need to make something that is bulletproof, something that you could drop at your friend’s (or relative’s) house and that it does everything by itself. Now your friend (or relative) probably doesn’t know how to open ports on their router or may not be able to, so how could you make a connection between their computer and yours?… Enter SSH tunneling… With ssh you could have your friend (or relative) connect to your computer and establish a reverse tunnel back to them (even on Windows with PUTTY), but again this is the person who is not that good with computers. Whenever your friend (or relative) needs their computer fixed you could run to their house and fix it… or you could figure out a way to connect to their computer to fix it. Let us say that you have a static IP on the internet and your friend (or relative) that always needs help fixing his computer has a dynamic IP address (constatly changes). Ssh -i ~/path_to/pineapple/id_rsa -L 0:0:0:0:8888 localhost:1471 I'm done with the GUI, I kill the ssh session on the relay server.Īlso, since the ssh client can fire one-off commands, anywhere I can get to the relay server I can typeĪnd get a shell to the pineapple AND a public web interface.Autossh is a great tool that is useful in establishing a persistent encrypted reverse tunnel between two computers. If you're interested in the manual command, it looks like this Since autossh is already connected to the relay server with -R, you can access the pineapple with `localhost`. ![]() I can ssh in to the relay server and type `ssh publicpi` and then I can access the web interface from anywhere by going to http::8888 Instead, I made an entry in ~/.ssh/config on the relay server. I didn't want the web interface public all the time so I didn't configure with autossh on the pineapple. My goal is simply to be able to manage my pineapple from the GUI and SSH through my home server when I deploy it remotely.įeel free to suggest any other method of achieving the said goal, with persistence of course. I must be missing something here, something to install/configure on the home server perhaps.? It seems to work for other SSH sessions on other ports,īut with my testing I had no luck forwarding http traffic from port 1471 with:ĭoes anyone has an idea on how this could be done? I have been told that I can make multiple tunnels by simply adding more instances of: Option ssh '-i ~/.ssh/id_rsa -N -T -R 420:localhost:22 gatetime '0' So far I tried with a similar config to the reverse SSH tunnel in /etc/config/autossh : So far much fun, but today I was wondering if it would be possible to tunnel the http traffic from the WebGUI on port 1471 to my server using the same idea.? I was playing around with my pineapple and managed to set up a reverse ssh with autossh so I can connect to my pineapple through my home server even if the pineapple is on another network, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |