Port forwarding

Figure 992. Forwarding port 80 to 2000 at localhost Slide presentation
Forwarding port 80 to 2000 at localhost

Figure 993. Frequent use e.g. connecting to remote database server Slide presentation
# Implicit for ssh-L localhost:2000:localhost:3306 ...
#
ssh -L 2000:localhost:3306 HostB # Mysql DB Server
# Originating host
#
$ telnet localhost:2000
Trying ::1...
Connected to localhost.
Escape character is '^]'.
DHost '127.0.0.1' is not allowed
to connect to this MariaDB server

exercise No. 7

ssh port forwarding

Q:

In this exercise we pretend you can access a host A by ssh but all other protocols shall be disables

  1. Create a server like in Improve your server's security! .

  2. Check for Nginx accessibility.

  3. Configure your firewall to allow ssh access only. This prohibits http/https access.

  4. Nginx should no longer be externally accessible.

  5. Follow Figure 992, “Forwarding port 80 to 2000 at localhost and forward port 80 of your remote host to port 2000 on your local workstation.

  6. Point your browser to http://localhost:2000 .