First of all, this is a small memo for me because I'll need to use this quite often the next weeks. So if it can be usefull for others, I post it here ;)

openssh.gif

  • I want to access to a private port on a remote host. This port will be mapped on a local port with the tunnel.
  • After creating the tunnel, the service will be accessible on the port localhost:LocalPort
  • All the communications will pass trough the SSH connection (so it will be ssl-encrypted)
ssh -f -N -L LocalPort:RemoteHost:RemotePort Login@RemoteHost
  • -f is to hide the session
  • -N and -L are there for the tunnel