Advanced remote management – SSH tunnels and SSH redirections
SSH has two really powerful features; that is, SSH tunnels and SSH redirections. When an SSH connection is established, it can not only be used to send commands to the remote host and let us work on them as if they were our local system, but we can also create tunnels that interconnect our systems.
Let's try to imagine a scenario that is common in many companies, where a VPN is used to reach the internal network with all the services and servers, but with SSH instead of a regular VPN.
So, let's put some context into this imaginary scenario.
We can use a host that gets external traffic for ssh
redirected from our internet router to the ssh
service in that system. So, in brief, our router gets connections on port 22
via TCP and the connection is forwarded to our server. We will be naming this server bastion in this exercise.
With this in place, our common sense tells us that we will be able to...