How to change tomcat jmx password's file permission
Solution 1
Follow the instructions on this page to protect the password file.
Solution 2
This will work on Windows 10 and 7.
In short:
-
open a windows command prompt in your ActiveMQ 'conf' folder.
-
use icacls (run 'icacls' without options for help) to change the owner to be 'you', in my case:
icacls jmx.password /setowner myuser
- remove all inherited permissions:
icacls jmx.password /inheritance:r
- grant minimal permissions to your user (read/write in this case):
icacls jmx.password /grant:r myuser:(r,w)
Solution 3
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
Admin
Updated on May 09, 2021Comments
-
Admin about 3 years
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:
-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.
Any thoughts?
-
Tinus Tate over 5 yearsThis also works on windows 10, very handy reply! But make sure you run the command prompt as Administrator.