I have a Linux VMSS and I'm able to access its VMs using inbound NAT rules defined on the load balancer.
Now, I have new security requirements that is preventing me from using certain ports. Therefore, I can no longer use the NAT ports (I currently use the pattern 5000*, so ports will look like 50000, 50001, etc). What I would like to do, is to be able to SSH using port 22, so instead of doing something like ssh -p 50000 myuser@PIP
, do ssh myuser@PIP
.
I tried accomplishing this using by adding a load balancer rule (thought it could work similarly to how a load balancer can distribute web traffic on port 80 without the need to specify a port). I created the rule like this:
az network lb rule create --resource-group MyResourceGroup --name MyLBRuleName --lb-name MyLBName --backend-pool-name MyBackendPoolName --backend-port 22 --frontend-ip-name loadBalancerFrontEnd --frontend-port 22 --protocol tcp
That did not work.
So, how can I SSH without using the NAT ports?