SSH (Secure Shell) is a widely used protocol for system administration and file transfer. It provides secure encrypted communication between two hosts over an insecure network. One of the key features of SSH is port forwarding, also known as SSH tunneling, which allows users to create encrypted connections and forward network traffic through SSH sessions. This guide will provide a comprehensive overview of SSH port forwarding, including its types and practical examples.
sudo nano /etc/ssh/sshd_config
AllowTcpForwarding yes GatewayPorts yes
sudo systemctl restart sshd
ssh -L 4000:127.0.0.1:3306 user@example.com
ssh -L 5901:127.0.0.1:5901 -L 4000:127.0.0.1:3306 user@example.com
VNC stands for Virtual Network Computing. It is a graphical desktop sharing system that allows users to remotely control and interact with graphical desktops of computers or servers over a network connection.
ssh -L 4000:server003.local:3306 user@example.com
ssh -R 7000:127.0.0.1:8000 user@example.com
ssh -R 8080:192.168.100.1:8000 user@example.com
ssh -D 4000 user@example.com
— Nadir Habib 2024/03/30 21:17