i have a requirement to have the SSH connectivity of the remote server in the azure network to our on prem network. Since the direct connectivity between both the networks are not available, i am trying to use IP tables to forward 22 traffic from server 1 to server 3.
Server 1 (on prem) --> server 2 (Azure DMZ network) --> server 3 (Backend application server)
though i can first log in to server2 and then take ssh from server 2 to server3, this approach wont work for our application requirement. Our application requirement is that we need direct SSH access from server1 to server 3.
ex: in putty if i use user@server2 IP it should redirect and connect the SSH session for server 3.
currently i tried doing it with IP tables to forward all 22 traffic f server 2 to server 3. In this approach through i see the packets forwarding. i am not getting the SSH session of server 3 from server 1 using server 2 IP.
note: In server i have changed the SSHd config file to have SSH running on different port to allow 22 port forwarding.
Please let me know if its possible in ubuntu such forwarding, if yes please guide me on the steps.
GatewayPorts yes
insshd_config
. Look at scenario 2 within the proposed duplication. – pa4080 May 25 '21 at 08:10