SSH Tunneling: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
({{Status}}/{{TOC}} 템플릿 제거)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Background ==
== Overview ==
SSH port forwarding 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.


== Enable or disable SSH port forwarding ==
SSH Tunneling에 대한 기술 문서입니다.
/etc/ssh/sshd_config has parameter


=== Summary ===


* 무엇인가? - SSH Tunneling
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


AllowTcpForwarding no|yes
== Purpose ==


이 문서가 존재하는 이유


* Goal: SSH Tunneling에 대한 기술 정보 제공
* Scope: SSH Tunneling의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장


Leaving port forwarding enabled can expose the organization to security risks and back-doors.
== Key Concepts ==


So make sure SSH AllowTcpForwarding is disabled state in your server.
{| class="wikitable"
! Concept
! Description
! Related
|-
| SSH Tunneling
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}


== Detailed Explanation ==


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.<ref>https://www.tenable.com/audits/items/CIS_Distribution_Independent_Linux_Workstation_L2_v2.0.0.audit:442b5a19a23bed7f8ac3fff5a9c41c01</ref>
<u>SSH port forwarding</u> (often referred to as <u>SSH tunneling</u>) 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.<ref>https://www.ssh.com/academy/ssh/tunneling-example</ref>
including default SSH port (22), binding listening ports under 1024, by default, requires root privileges.
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].'''<syntaxhighlight lang="bash">
#Local Port Forwarding with OpenSSH,
#Expose a local service to the intranet via internal SSHD
ssh -L ACL_IP:local_port:destination_server_ip:destination_server_port user@ssh_server
#without ACL_IP(0.0.0.0) only locahost host 127.0.0.1 can be accessable. you can check netstat command
example : ssh -L 0.0.0.0:4321:10.211.55.21:22 user@10.211.55.21 -N
Redirect all trafic on 4321 port to 10.211.55.21 port 22 for SSH connection, -N means do not execute this command on the shell
#Remote Port Forwarding with OpenSSH
#Expose a local service to the outside world via public accessable gateway.
ssh -R remote_port:localhost:local_port ssh_gateway_server
#Dynamic Port Forwarding with OpenSSH
ssh –D local_port ssh_server_hostname
Multiple Tunnels and Multiple Host Hopping
ssh -X -L 5432:<DB server IP>:5432 -R 873:<local RSYNC server>:873
</syntaxhighlight>
* '''SSH tunnels to reach farther SSH servers'''
ssh -L 8022:<server2>:22 user@server1
ssh -L 8023:<server3>:22 -p 8022 user@server2


== Reference ==
== Best Practices ==
<references />
 
* 최신 버전 사용 권장
* 공식 문서 참고
* 테스트 환경에서 먼저 검증
 
== References ==
 
* [https://wiki.hpcmate.com SSH Tunneling]
 
== Related Pages ==
 
* [[Linux]]
* [[Server]]
* [[Hardware]]
* [[Network]]
 
[[Category:Server]]
== Knowledge Graph ==
 
Related
 
→ [[Linux]]
→ [[Server]]
→ [[Hardware]]
→ [[Network]]
 
[[Category:Reference]]

Latest revision as of 13:25, 2 October 2026

Overview

SSH Tunneling에 대한 기술 문서입니다.

Summary

  • 무엇인가? - SSH Tunneling
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시

Purpose

이 문서가 존재하는 이유

  • Goal: SSH Tunneling에 대한 기술 정보 제공
  • Scope: SSH Tunneling의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장

Key Concepts

Concept Description Related
SSH Tunneling HPC/서버 환경에서 중요한 기술 개념 Linux, Server

Detailed Explanation

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.[1] including default SSH port (22), binding listening ports under 1024, by default, requires root privileges.

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, 
#Expose a local service to the intranet via internal SSHD
ssh -L ACL_IP:local_port:destination_server_ip:destination_server_port user@ssh_server
#without ACL_IP(0.0.0.0) only locahost host 127.0.0.1 can be accessable. you can check netstat command
example : ssh -L 0.0.0.0:4321:10.211.55.21:22 user@10.211.55.21 -N 
Redirect all trafic on 4321 port to 10.211.55.21 port 22 for SSH connection, -N means do not execute this command on the shell
#Remote Port Forwarding with OpenSSH
#Expose a local service to the outside world via public accessable gateway.
ssh -R remote_port:localhost:local_port ssh_gateway_server
#Dynamic Port Forwarding with OpenSSH
ssh –D local_port ssh_server_hostname
Multiple Tunnels and Multiple Host Hopping
ssh -X -L 5432:<DB server IP>:5432 -R 873:<local RSYNC server>:873
  • SSH tunnels to reach farther SSH servers
ssh -L 8022:<server2>:22 user@server1
ssh -L 8023:<server3>:22 -p 8022 user@server2

Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증

References

Related Pages

Knowledge Graph

Related

→ Linux → Server → Hardware → Network