SSH Tunneling / Port Forwarding

ssh -f -L 2222:
ssh -f -L localhost -N
  • -f force
  • -L local
  • -N don’t execute any commands at remote host
  • 2222 is local port
  • is remote server
  • 22 is remote port
  • localhost is the system we’re creating an alias for

It looks like you have connected to yourself, but what you have done is you’ve tunneled your connection on the 2222 local port. Now you have a gateway to a remote network.