How to change tomcat jmx password's file permission

20,680

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:

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

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

icacls jmx.password /setowner myuser

  1. remove all inherited permissions:

icacls jmx.password /inheritance:r

  1. 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

Share:
20,680
Admin
Author by

Admin

Updated on May 09, 2021

Comments

  • Admin
    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
    Tinus Tate over 5 years
    This also works on windows 10, very handy reply! But make sure you run the command prompt as Administrator.