Creating a new user

Let's explore the creation of a new user in this section. Log in to Kibana (http://locahost:5601) as the elastic user:

  1. To create a new user, navigate to the Management UI and select Users in the Security section:

  1. The Users screen displays the available users and their roles. By default, it displays the default/reserved users that are part of the native X-Pack security realm:

  1. To create a new user, click on the Create new user button and enter the required details, as shown in the following screenshot. Then, click on Create user:

Now that the user has been created, let's try to access some Elasticsearch REST APIs with the new user credentials and see what happens. Execute the following command and check the response that's returned. Since the user doesn't have any role associated with them, the authentication is successful. The user gets HTTP status code 403, stating that the user is not authorized to carry out the operation:

curl -s -H "Content-Type: application/json" -u user1:password -XGET http://localhost:9200
Response:
{"error":{"root_cause":[{"type":"security_exception","reason":"action [cluster:monitor/main] is unauthorized for user [user1]"}],"type":"security_exception","reason":"action [cluster:monitor/main] is unauthorized for user [user1]"},"status":403}
  1. Similarly, go ahead and create one more user called user2 with the password set as password.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.141.20