JMX验证 [英] JMX authentication

查看:149
本文介绍了JMX验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ cd $JAVA_HOME/jre/lib/management
$ cp jmxremote.password.template jmxremote.password
$ chmod u=rw jmxremote.password
$ vi jmxremote.password

设置"monitorRole"和"controlRole"的密码:

Set a password for "monitorRole" and "controlRole":

monitorRole 12monitor
controlRole 55control

然后,当我在计算机上运行JMX服务器时,出现以下错误.

After then when I run JMX server on my machine I got following error.

# java -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.m
agement.jmxremote.authenticate=true  -Dcom.sun.management.jmxremote.ssl=false -D
java.rmi.server.host=47.168.96.31  com.example.Main
Error: Password file read access must be restricted: /root/Downloads/jdk1.6.0_29
/jre/lib/management/jmxremote.password

当我使用以下命令之一更改文件许可权时,jmx服务器将起作用.

When I change the file permission with the oen of the following commands jmx server works.

# chmod 400  jmxremote.password

# chmod 600  jmxremote.password

但是我无法通过jmxremote.password文件中定义的用户名/密码进行连接

But I could not connect it through username/password defined in jmxremote.password file

推荐答案

要为JMX授权添加新的用户名/密码,必须定义身份验证 通过将用户名添加到jmxremote.access文件中.就像添加用户名"admin"时一样

To add new username/password for JMX authorization, authentication has to be defined by adding the username in to jmxremote.access file. it should be like when adding username "admin"

>monitorRole   readonly
>admin         readonly
>controlRole   readwrite \
          create javax.management.monitor.*,javax.management.timer.* \
          unregister

这篇关于JMX验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆