java 如何更改tomcat jmx密码的文件权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6501101/
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-10-30 16:07:33  来源:igfitidea点击:

How to change tomcat jmx password's file permission

javatomcatjmx

提问by

I am trying to secure JMX access on my local tomcat instance hosted on Windows platform. I have created access and password files and plugged those using the following VM arguments:

我正在尝试保护在 Windows 平台上托管的本地 tomcat 实例上的 JMX 访问。我已经创建了访问和密码文件,并使用以下 VM 参数插入了这些文件:

-Dcom.sun.management.jmxremote.password.file
-Dcom.sun.management.jmxremote.access.file 

But I am running into an issue during tomcat start-up: Error: Password file read access must be restricted. I tried changing the password's file owner and access using file security tab but it doesn't seem to be working.

但是我在 tomcat 启动期间遇到了一个问题:Error: Password file read access must be limited。我尝试使用文件安全选项卡更改密码的文件所有者和访问权限,但它似乎不起作用。

Any thoughts?

有什么想法吗?

采纳答案by helios

Follow the instructions on this pageto protect the password file.

按照此页面上的说明保护密码文件。

回答by Axel Podehl

Thiswill work on Windows 7.

将适用于 Windows 7。

In short:

简而言之:

1) open a windows command prompt in your ActiveMQ 'conf' folder.

1) 在您的 ActiveMQ 'conf' 文件夹中打开 Windows 命令提示符。

2) use icacls (run 'icacls' without options for help) to change the owner to be 'you', in my case:

2) 使用 icacls(在没有帮助选项的情况下运行“icacls”)将所有者更改为“你”,在我的情况下:

icacls jmx.password /setowner myuser

icacls jmx.password /setowner myuser

3) remove all inherited permissions:

3)删除所有继承的权限:

icacls jmx.password /inheritance:r

icacls jmx.password /inheritance:r

4) grant minimal permissions to your user (read/write in this case):

4)授予您的用户最小权限(在这种情况下是读/写):

icacls jmx.password /grant:r myuser:(r,w)

icacls jmx.password /grant:r myuser:(r,w)

回答by Sohan

This worked for me, in command prompt go to your file location and type,

这对我有用,在命令提示符下转到您的文件位置并键入,

cacls jmxremote.password /P [username]:R

Replace [username] with your own username

将 [username] 替换为您自己的用户名