SSH Port Forwarding allows you to forward a port to another port, enabling secure and indirect access to network services.
Configure Port Forwarding:
Set up SSH Port Forwarding so that requests to port 8081 on dlp.emc.world (10.0.0.30) are forwarded to port 80 on node01.emc.world (10.0.0.51).
ssh -L 10.0.0.30:8081:10.0.0.51:80 user@target_host
Example:
ssh -L 10.0.0.30:8081:10.0.0.51:80 cent@node01.emc.world
Enter the password when prompted.
Check Forwarding Status:
On the source host, confirm the port forwarding status.
ssh source_host "ss -napt | grep 8081"
Example:
ssh dlp.emc.world "ss -napt | grep 8081"
You should see a line indicating that port 8081 is listening, which confirms the setup.
Test Access to Forwarded Port:
Access the port on the source host from any client host. The target port on the target host should respond.
# Example: Accessing port 8081 on dlp.emc.world from another host
The request will be forwarded to port 80 on node01.emc.world.
Note: Replace source_host, target_host, user, 10.0.0.30, 10.0.0.51, and other placeholders with actual hostnames, IP addresses, and user names relevant to your setup. This document guides users through configuring and verifying SSH Port Forwarding, a powerful feature for secure and flexible network management.