Java JMX RMI身份验证不工作
我已将Java应用程序配置为需要身份验证,但不需要SSL JVM参数:Java JMX RMI身份验证不工作,java,authentication,jmx,jconsole,Java,Authentication,Jmx,Jconsole,我已将Java应用程序配置为需要身份验证,但不需要SSL JVM参数: -Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=localIpAddress management.properties: com.sun.management.jmxremote.rmi.port=39998 com.sun.management.jmxremote.port=39
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=localIpAddress
management.properties:
com.sun.management.jmxremote.rmi.port=39998
com.sun.management.jmxremote.port=39999
com.sun.management.jmxremote.authenticate=true
com.sun.management.jmxremote.ssl=false
jmxremote.access
monitorRole readonly
dev readwrite
tester readwrite
jmxremote.password
monitorRole guest
dev dev
tester test
但是,我可以访问此应用程序,而无需输入任何凭据
jconsole ipOfApplication:39998
我可以直接访问,无需任何密码提示。如何确保系统提示我登录
注意:即使启用SSL,也会发生相同的行为。您可以使用以下配置:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6002
-Dcom.sun.management.jmxremote.rmi.port=6003
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
并在FW上为JMX流量打开端口60026003。这将使您能够远程访问JMX服务器,而无需引入任何自定义RMI代理。使用自定义RMI代理有任何特殊原因吗?在国际海事组织,问题是由代理引起的。开箱即用的配置在JDK7u45上测试正常,JDK8B115如果没有自定义RMI代理,我无法访问JMX应用程序。我假设您需要通过防火墙路由JMX流量,对吗?是的,根据本文中的答案,默认情况下,远程连接必须打开大量端口才能工作。实际上,由于JDK7u4可以指定RMI注册表端口——这是导致问题的原因——请参见这里,我已经验证了该属性对我有效,因此我不必使用自定义代理。但是,我仍然面临着与以前相同的问题:在没有身份验证的情况下允许访问。我想确保所有访问都经过身份验证。