Member-only story

SSH Tunneling : Remote Forwarding

Dheeraj kumar
2 min readJun 12, 2021

what: The process of accessing the INTERNAL server through a public server or local system is known as SSH TUNNELLING: REMOTE FORWARDING

How: These are some configurations that need to be changed on both the server and client-side.

Steps 1. On Server Side ( Internal VM ):

Change these variables in this file : FILE=/etc/ssh/sshd_config

AllowTcpForwarding remote
GatewayPorts yes

2. Save it and run this command to restart your ssh service.

sudo systemctl restart ssh

3. RUN this command to create a ssh tunnel.

nohup ssh -nNv -R 8002:localhost:22 admin@abc.com &

Command breakup :

nohup, & : to run this process in background

ssh: secure shell

-nN : to not allocate a tty( terminal ) and only do the port forwarding.

-v : verbose ( detailed output )

-R : Specifies that the given port of the remote server host is to be forwarded to the given host and port on the local side.

8002 : Client-side port on which ssh connection will be establish.

22 : server side port ( ssh )

admin@abc.com: Azure Vm USERNAME@HOST-DNS

On Client side ( Azure Vm ):

--

--

Dheeraj kumar
Dheeraj kumar

Written by Dheeraj kumar

A DevOps/MLOps/GitOps/SecOps who is passionate about Autom@tion.

No responses yet