Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMX password read access issue

Tags:

java

ubuntu

jmx

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

like image 323
Black Magic Avatar asked Oct 07 '13 08:10

Black Magic


People also ask

What is Jmxremote password file?

The jmxremote. access file defines the allowed access for different roles and the jmxremote. password file defines the roles and their passwords. To be functional, a role must have an entry in both the password and the access files.


1 Answers

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.

like image 97
Elad Tabak Avatar answered Sep 29 '22 06:09

Elad Tabak