Java JMX 密码读取访问问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19220442/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 15:11:14  来源:igfitidea点击:

JMX password read access issue

javaubuntujmx

提问by Black Magic

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

当我尝试使用 JMX 来监视这样的应用程序时:

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 chmodto restrict the read access, it tells me:

然而,当我chmod用来限制读取访问时,它告诉我:

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

这是 Ubuntu btw,带有最新的 oracle jdk

采纳答案by Elad Tabak

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

确保您用来运行 java 进程的用户有权访问该文件(所有者/读取权限)。

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.

都解释到这里了