docs/operating-scylla/security/create-superuser.rst
There is no default superuser role in ScyllaDB. Users with a superuser role have full access to the database and can run any CQL command on the database resources.
There are two ways you can create a superuser in ScyllaDB:
Using the ScyllaDB Maintenance Socket to create a superuser role <create-superuser-using-maintenance-socket>Using an existing superuser account to create a new superuser role <create-superuser-using-existing-superuser>When setting up a new cluster, use the maintenance socket approach to create the first superuser.
.. _create-superuser-using-maintenance-socket:
If no superuser account exists in the cluster, which is the case for new clusters, you can create a superuser using the ScyllaDB Maintenance Socket.
In order to do that, the node must have the maintenance socket enabled.
See :doc:Admin Tools: Maintenance Socket </operating-scylla/admin-tools/maintenance-socket/>.
To create a superuser using the maintenance socket, you should:
cqlsh over the maintenance socket... code-block:: shell
cqlsh <maintenance_socket_path>
Replace <maintenance_socket_path> with the socket path configured in scylla.yaml.
CREATE ROLE command... code-block:: cql
CREATE ROLE <new_superuser> WITH SUPERUSER = true AND LOGIN = true and PASSWORD = '<new_superuser_password>';
cqlsh command with the new password... code-block:: shell
cqlsh -u <new_superuser> Password:
.. note::
Enter the value of <new_superuser_password> password when prompted. The input is not displayed.
.. code-block:: cql
LIST ROLES;
.. _create-superuser-using-existing-superuser:
To create a superuser using an existing superuser account, you should:
.. code-block:: shell
cqlsh -u <existing_superuser> Password:
.. note::
Enter the value of <existing_superuser_password> password when prompted. The input is not displayed.
.. code-block:: cql
CREATE ROLE <new_superuser> WITH SUPERUSER = true AND LOGIN = true and PASSWORD = '<new_superuser_password>';
cqlsh command with the new password... code-block:: shell
cqlsh -u <new_superuser> Password:
.. note::
Enter the value of <new_superuser_password> password when prompted. The input is not displayed.
.. code-block:: cql
LIST ROLES;