![]() I’ll refer to the box that initiates the connection as Host A, and the box that we connect to as Host B.Ĭreate a ‘tunnel’ user on Host A: ~]# useradd -d /home/tunnel ~]# passwd tunnel # Set a strong ~]# su - tunnel # Become the user 'tunnel' SSH allows you to map both local and remote ports, so it doesn’t really matter which end of the connection you choose to initiate the connection. That user will then be used to create the tunnel and run a script via cron to ensure that it remains up.įirst, select one of the servers that will initiate the SSH connection. The steps described here will create an unprivileged user named ‘tunnel’ on each server. The SSH commands for port forwarding can be found in the ssh man page. Google can identify plenty of resources regarding the fundamental SSH commands for port forwarding but I didn’t ever find a good resource for setting up a connection and ensuring that it remains active, which is what I hope to provide here. ![]() My need was to allow regular non-encrypted MySQL connections over an encrypted tunnel, but there could be many other uses as well. ![]() I recently had a need to create a permanent SSH tunnel between Linux servers.
0 Comments
Leave a Reply. |