Ssh Setup a SSH Tunnel: Difference between revisions
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
=Setting a Tunnel from a Local Port to a Port on a Remote Host= | =Setting a Tunnel from a Local Port to a Port on a Remote Host= | ||
ssh -f [-p <''remote-host-ssh-port''> -f <''identity-file''>] <''remote-host-ssh-user''>@<''remote-host-address-on-which-ssh-is-exposed''> -L <''local-port''>:<''remote-host-interface-to-forward-to''>:<''port-on-remote-host''> -N | ssh -f [-p <''[[#remote-host-ssh-port|remote-host-ssh-port''> -f <''identity-file''>] <''remote-host-ssh-user''>@<''remote-host-address-on-which-ssh-is-exposed''> -L <''local-port''>:<''remote-host-interface-to-forward-to''>:<''port-on-remote-host''> -N | ||
The "-f" option tells ssh to go to background. | The "-f" option tells ssh to go to background. | ||
Line 16: | Line 16: | ||
The meaning of other arguments is the following: | The meaning of other arguments is the following: | ||
* <span id='remote-host-ssh-port'></span>-p <''remote-host-ssh-port''> may be used to specify a non-standard SSH port, if the SSH daemon on the remote host was configured to listen on a port other than 22. |
Revision as of 02:56, 27 December 2018
Internal
Overview
OpenSSH can be used to tunnel traffic from the local host to a remote host you have an account on.
Setting a Tunnel from a Local Port to a Port on a Remote Host
ssh -f [-p <[[#remote-host-ssh-port|remote-host-ssh-port> -f <identity-file>] <remote-host-ssh-user>@<remote-host-address-on-which-ssh-is-exposed> -L <local-port>:<remote-host-interface-to-forward-to>:<port-on-remote-host> -N
The "-f" option tells ssh to go to background.
The "-N" option tells ssh to NOT execute any command on the remote system. If "-N" is omitted, the ssh tunnel will establish AND login.
The meaning of other arguments is the following:
- -p <remote-host-ssh-port> may be used to specify a non-standard SSH port, if the SSH daemon on the remote host was configured to listen on a port other than 22.