JMX password read access issue
Asked Answered
C

2

42

When I try to use JMX to monitor an application like this:

java -Dcom.sun.management.jmxremote.port=9999 \
     -Dcom.sun.management.jmxremote.authenticate=false \
     -Dcom.sun.management.jmxremote.ssl=false \
     JMX_tester

it tells me:

Error: Password file read access must be restricted:
       /usr/lib/jvm/java-7-oracle/jre/lib/management/jmxremote.password

Yet, when I use chmod to restrict the read access, it tells me:

Error: can't read password file

Am I going insane or something? How can I fix this?

This is Ubuntu btw, with the latest oracle jdk

Calida answered 7/10, 2013 at 8:48 Comment(1)
Same issue for me on Windows.Eradicate
M
70

Make sure the user you are using to run the java process have access to the file (owner/read permissions).

Try:

chmod 600 jmxremote.password

Plus I suggest you'll make your own password file and run it with

-Dcom.sun.management.jmxremote.password.file=pwFilePath

All explained here.

Matilda answered 7/10, 2013 at 8:55 Comment(6)
Windows users, check this answer to another question: https://mcmap.net/q/391796/-how-to-change-tomcat-jmx-password-39-s-file-permissionEradicate
But when authenticate=false is set why we need password ...?Oxus
@KanagaveluSugumar Check your property spelling, possible overrides, etc. in your configuration. It tends to be error prone. However, the authenticate=false really disables the password checks.Block
Any answers to this ?Panelist
@Panelist to what question are you referring?Matilda
@EladTabak I was also getting the same issue inspite of having set the "-Dcom.sun.management.jmxremote.authenticate=": "false". So I my question was if it is set to false why is it looking for the password folder.Panelist
D
2

If you want to bypass authentication try to use below parameters.

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=port
-Dcom.sun.management.jmxremote.ssl=false
Dichotomous answered 12/8, 2022 at 9:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.