Add a superuser account

After you enable role-based access control (RBAC), create your own superuser account and disable or drop the default cassandra account. Roles that you create with the superuser option have full access to the database, and users with the superuser role can run any Cassandra Query Language shell (cqlsh) commands on all database resources.

Only provide superuser roles to a limited number of users.

DataStax Enterprise (DSE) includes the default role cassandra with a default password of cassandra. The cassandra role is a superuser login account that has full access to the database. Requests from the cassandra account, including login, use a consistency level of QUORUM. QUORUM might cause significant performance degradation in multiple datacenter environments.

Because of these security and performance considerations, DataStax recommends that you use the cassandra role only once during the initial RBAC setup. Establish your own root account with superuser privileges, and then disable or drop the cassandra role.

Requests from all other authenticated accounts have a consistency level of LOCAL_ONE. For more information, see How is the consistency level configured?

Prerequisites

Isolate the DSE cluster and enable RBAC. For more information, see Set up logins and users.

Create and use a superuser account

  1. Log in to CQL shell with the cassandra user:

    cqlsh -u cassandra -p cassandra
  2. Create a new superuser account and password:

    CREATE ROLE <root_user_name>
      WITH SUPERUSER = true
      AND LOGIN = true
      AND PASSWORD = '<password>';

    or create the new superuser account with a hashed password:

    CREATE ROLE <root_user_name>
      WITH SUPERUSER = true
      AND LOGIN = true
      AND HASHED PASSWORD = '<hashed_password>';
  3. Exit the CQL shell:

    EXIT;

Disable or drop the default cassandra account

  1. To disable or drop the cassandra role, log in with the new role created in the Create and use a superuser account step:

    cqlsh -u <root_user>

    Enter the password at the prompt.

  2. Use the LIST ROLES command to verify that the role has superuser privileges:

    LIST ROLES;
     role                | super | login | options
    ---------------------+-------+-------+---------
               root_user |  True |  True |        {}
               cassandra |  True |  True |        {}
    (2 rows)
  3. Drop or update the cassandra account:

    • Drop the cassandra account:

      DROP ROLE cassandra;
    • Update the cassandra role by disabling the superuser privileges and changing the password:

      ALTER ROLE cassandra
        WITH SUPERUSER = false
        AND LOGIN = false
        AND PASSWORD='new_secret_pw';

      or with a hashed password:

      ALTER ROLE cassandra
      WITH SUPERUSER = false
      AND LOGIN = false
      AND HASHED PASSWORD='$2a$10$4N5j5py12OySiSy9L2RHduOjFFetJ1d9hqCoZYtQC3kJOwdg3hbOC';

    DataStax recommends that you drop the account to secure the database in production environments. When you use an external authentication method, such as LDAP, you can prevent accidental assignment of unnecessary privileges.

  4. Verify that you deleted the cassandra role:

    LIST ROLES;

    The system no longer lists the cassandra role. Only the new root user that you created appears in the output:

     role                | super | login | options
    ---------------------+-------+-------+---------
               root_user |  True |  True |        {}
    
    (1 rows)
  5. Reopen the firewall to support production CQL traffic.

Next steps

To set up roles that map to the user or group names for the configured authentication schemes, see Add database users.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com