SSH Tunneling: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
Line 3: Line 3:




Using OpenSSH in [[Linux]] we can '''enable local, remote, or dynamic SSH port forwarding between client and server. more detailed guide can be found at [https://phoenixnap.com/kb/ssh-port-forwarding phoenixnap].'''
Using OpenSSH in [[Linux]] we can '''enable local, remote, or dynamic SSH port forwarding between client and server. more detailed guide can be found at [https://phoenixnap.com/kb/ssh-port-forwarding phoenixnap] and [https://audviklabs.com/how-to-set-up-ssh-tunneling-port-forwarding/ audviklabs].'''


* Local Port Forwarding with OpenSSH
* Local Port Forwarding with OpenSSH

Revision as of 09:23, 4 May 2023

Background

SSH port forwarding (often referred to as SSH tunneling) is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network.


Using OpenSSH in Linux we can enable local, remote, or dynamic SSH port forwarding between client and server. more detailed guide can be found at phoenixnap and audviklabs.

  • Local Port Forwarding with OpenSSH

ssh -L local_port:destination_server_ip:remote_port ssh_server_hostname

  • Remote Port Forwarding with OpenSSH

ssh -R remote_port:localhost:local_port ssh_server_hostname

  • Dynamic Port Forwarding with OpenSSH

ssh –D local_port ssh_server_hostname

Enable or disable SSH port forwarding

/etc/ssh/sshd_config has parameter


AllowTcpForwarding no|yes


SSH port forwarding is a powerful feature, and it needs to be carefully administered since leaving port forwarding enabled can expose the organization to security risks and back-doors.

Disabling SSH AllowTcpForwarding is recommended to prevent potential issues

SSH tunnels are widely used in many enterprise environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications.[1]

Reference