By default, Cassandra’s username and password authentication are disabled. It is, therefore, up to you to enable and configure auth methods for your cluster.
This tutorial aims to show you how you can set up a basic username and password authentication on your Cassandra cluster by editing various config options.”
Let’s dive in.
Step 1 – Configure the Cassandra Authentication Backend
The first step in enabling user authentication for your cluster is defining your authenticator backend
Edit your cassandra.yml file and locate the authenticator entry. Change this value from AllowAuthenticator to PasswordAuthenticator.
authenticator: AllowAuthenticator
# after
authenticator: PasswordAuthenticator
Step 2 – Configure Cassandra Authorization Backend
Next, configure the Cassandra Authorizer backend entry as shown:
authorizer: AllowAllAuthorizer
# after
authorizer: CassandraAuthorizer
Save the changes to the config file and close.
Step 3 – Restart Cassandra
Once you have saved the changes to the config file, restart the cassandra cluster using your default service manager.
Step 4 – Login to Cassandra
Once the server is up and running, login to the cluster using the default username and password.
If successful, you should be dropped to the CQL Shell as the cassandra user. This is a superuser account for administration purposes.
Creating a new user account with standard privileges is recommended when executing non-admin commands to the server.
Check out our tutorial on creating Cassandra users and roles to discover more.
Final Thoughts
Once you have configured your username and passwords, you can modify other settings related to Cassandra security, such as role validity, user permissions, network authorization and more. Check the docs to discover more.
Thanks for reading & see you in the next one.