---
title: "Managing Kafka users"
sidebar_label: "User management"
description: "Learn how to create a user, change their password, configure access to a Kafka database, and manage privileges"
sidebar_position: 5
toc_max_heading_level: 2
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import CheckIcon from '@selectel/docux/icons/check'
import EditIcon from '@selectel/docux/icons/edit'

# Managing Kafka users

The Kafka data bus is used for message streaming. To access the message queue in Kafka cluster [topics](/managed-databases/kafka/manage-topics.mdx), you must first [create a user](#create-user). The user is assigned [roles](#user-roles) that define the user's ability to read and send messages in a topic. You can [assign a role to the user and grant access](#grant-user-access):

* for a single topic;
* multiple topics by prefix;
* all topics.

## Create a user \{#create-user}

1. In the [Dashboard](https://my.selectel.ru/vpc/default/dbaas/), on the top menu, click **Products** and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the database cluster page → **Users** tab.
4. Click **Create User**.
5. Enter a username and password. Save the password — it will not be stored in the dashboard.
6. Click **Create**.

## Change user password \{#change-user-password}

After the cluster is created, the user password can be changed. Do not forget to update the password in your application.

1. In the [Dashboard](https://my.selectel.ru/vpc/default/dbaas/), on the top menu, click **Products** and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the cluster page → **Users** tab.
4. In the user menu, select **Change password**.<MoreVerticalIcon />
5. Enter or generate a new password and click **Save**.

## User roles \{#user-roles}

Users can have the following roles:

* consumer — receives and processes messages from a topic to which they have access;
* producer — sends messages to a topic to which they have access.

For more information, see the Apache Kafka documentation for [consumers](https://kafka.apache.org/documentation/#theconsumer) and [producers](https://kafka.apache.org/documentation/#theproducer).

## Grant access to a user \{#grant-user-access}

1. In the [Control panel](https://my.selectel.ru/vpc/default/dbaas/), click **Products** in the top menu and select **Managed Databases**.

2. Open the **Active** tab.

3. Open the cluster page → **Users** tab.

4. In the user menu, select **Configure access**.<MoreVerticalIcon />

5. Choose the topic access type:

   * by prefix — to multiple topics identified by a repeating start of their name;
   * by name — to a specific topic. Available only if topics have been created;
   * all topics.

6. If you selected topic prefix access type, enter the prefix in the **Value** field.

7. If you selected topic name access type, select the topic name in the **Value** field.

8. Select a [user role](#user-roles). You can assign one or two roles to a user.

9. Click .<CheckIcon />

10. To grant multiple accesses to a user, click **Add access** and repeat steps 5-9.

## Change user access \{#change-user-access}

In the access row, you can only change the role. If you need to change the access type or value, delete the access row you need to fix and [add a new access](#grant-user-access).

1. In the [Control panel](https://my.selectel.ru/vpc/default/dbaas/), click **Products** in the top menu and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the cluster page → **Users** tab.
4. In the user menu, select **Configure access**.<MoreVerticalIcon />
5. To change the role, click in the access row.<EditIcon />
6. Change the role.
7. Click .<CheckIcon />

<Formbricks />
