Firewall rules for jstatd

1.6k Views Asked by At

I'm trying to run a jstatd on a remote server. According to the documentation I created a policy file and startet the deamon with the following command:

jstatd -p 1199 -J-Djava.security.policy=<path-to-policy>

In the following posts I read that there are 2 ports I must open in my firewall: jps can't connect to a remote jstatd

After opening these 2 ports everything works fine (including connection to my remote Java-Applications via VisualVM). Now I've read that 1199 port is fix, but the second one is a random port at each startup of the jstatd (Using VisualVM to connect to a remote jstatd instance through a firewall). That makes my firewall ruling quite complicated. Is there any possibility to set the port to a fixed value? My problem is that I can't change the firewall every time the jstatd is (re)started.

Thanks in advance for your help and best regards, AnarchoEnte

1

There are 1 best solutions below

0
On

I guess the best solution is to use ssh tunnel with SOCKS proxy created via ssh -D. Once you have it, set the SOCKS proxy in VisualVM preferences. See this article at DZone for detailed info.