![]() ![]() If you want your ssh tunnels to persist over a reboot you would need to create a startup script. Having autossh monitor your tunnels is a great advantage, but it still requires a command to be run whenever autossh itself would die, such as after a reboot. Please read more here for details on how to setup public key authentication. Especially if you want to follow the rest of this article and have the tunnels start automatically. So instead of running the command above you could run: autossh -NL 8080:127.0.0.1:80 starting an ssh tunnel with autossh assumes that you have set up public key authentication between the client and server since there’s no way for autossh to ask you for the password. If the tunnel stopped working autossh will simply restart it again. AutosshĪutossh is a tool that sets up a tunnel and then checks on it every 10 seconds. Depending on your situation this might be a problem and that’s why autossh exists. Whenever the ssh connection breaks the tunnel will break and you have to rerun that command again. There’s really only one problem with this. tells ssh to connect to 192.168.10.10 with username root.So, on the machine that runs this command, anything sent to 127.0.0.1:8080 is forwarded to port 80 on the other side 8080:127.0.0.1:80 tells ssh that the listening side should listen on port 8080 of it’s localhost interface and the other side should forward it to port 80.If you want it the other way around, use -R instead. -L means that the local side is the listening side.-N means that SSH should just create the connection and then do nothing.Setting up an ssh tunnel is quite straigt forward, for example at the terminal: ssh -NL 8080:127.0.0.1:80 break that down: Natrually the traffic is encrypted on it’s way, thereby creating a miniature VPN. When the packets arrive on the target side, the OpenSSH software forwards them to the correct local port. On one side of the tunnel, the OpenSSH software takes anything that is sent to a specific port and sends it over to the other side of the connection. An SSH tunnel works by setting up an ssh connetion between two hosts and use that connection to transport normal network traffic. In situations when no VPN is either not available or you just think it’s an overkill to configure an ssh tunnel can be a pretty good alternative.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |