I have to host a Webserver/SSH server at "Server B" which is without public IP,
I purchased a VPS "Server A" with a public IP and I am doing reverse SSH port forwarding as
Internet --> 22 : "Server A" --> 22 : Server B Internet --> 443 : "Server A" --> 443 : Server B
So accessing "Server A" at port 22 forwards to "Server B" at port 22 as expected
I cant see the source IP accessed at "Server B" , I just see the source IP as localhost, Due to regular brute forcing attacks at SSH , I need fail2ban at "server B' but that has been useless because of no source IP.
I cannot change the port from 22 to something else.
I have tried VPN from "Server B" to "Server A" but I couldn't setup the iptables rules at "Server A" to forward a specific port from "Server A" to "Server B".
What could I do best so that I can get the source IP at "Server B" ?