DataStax Help Center

Step by step instructions for securing JMX authentication for nodetool utility, OpsCenter and JConsole


It's possible to secure JMX authentication which makes JMX compliant utilities such as nodetool, OpsCenter and JConsole ask for password authentication.

Enabling JMX authentication can be a simple way to ensure only certain people can use utilities like nodetool, OpsCenter and JConsole. For example, some system administrators prefer to secure nodetool usage as it can be used to add and remove nodes. 

JMX authentication

1) Edit /etc/dse/cassandra/ update/add these lines:



2) Copy the jmxremote.password.template from /<jre_install_dir>/lib/management/ to /etc/cassandra/ and rename to jmxremote.password:

cp /<jre_install_dir>/lib/management/jmxremote.password.template /etc/cassandra/jmxremote.password


3) Change ownership to cassandra and permission

chown cassandra:cassandra /etc/cassandra/jmxremote.password
chmod 400 /etc/cassandra/jmxremote.password


4) Edit jmxremote.password and add the user and password:

monitorRole QED
controlRole R&D
cassandra cassandra


5) Add cassandra with readwrite permission to /<jre_install_dir>/lib/management/jmxremote.access:

monitorRole readonly
cassandra readwrite
controlRole readwrite \
create*,* \


6) Restart DSE

/etc/init.d/dse restart


7) Run nodetool with user and password:

nodetool -u cassandra -pw cassandra status


Without user and password you will see this error:

root@VM1 cassandra]# nodetool status
Exception in thread "main" java.lang.SecurityException: Authentication failed! Credentials required
at Source)
at Source)
at$AccessFileCheckerAuthenticator.authenticate(Unknown Source)
at Source)
at Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$ Source)
at sun.rmi.transport.Transport$ Source)
at Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at Source)
at Source)
at Source)
at Source)


OpsCenter Changes

If you are using OpsCenter you need to add the JMX credentials for nodes to connect:


1) In OpsCenter select Edit Cluster, enter user name and password under JMX Username and JMX Password.


2) Restart OpsCenter agent on each node

/etc/init.d/opscenterd restart


3) You can check if the JMX credentials were added to OpsCenter by viewing this file:


It should contain an entry like this:

username = cassandra
password = cassandra
port = 7199



 If using JConsole you will need to provide username and password when connecting to the host.

Was this article helpful?
6 out of 6 found this helpful
Have more questions? Submit a request


  • Avatar
    Victor Chen

    There doesn't seem to be much information regarding the significance of the roles. What is their significance and how are those entries used, or why are they needed? Thanks.

    monitorRole QED

    controlRole R&D

  • Avatar
    Sucwinder Bassi

    I've not tested without the other roles, but you could probably just add cassandra username, password and permission.

Powered by Zendesk