# Set username and password for Kibana without using xpack

**URL:** <https://discuss.elastic.co/t/set-username-and-password-for-kibana-without-using-xpack/133101>\
**Category:** Kibana\
**Created:** [May 24, 2018, 9:31am UTC](https://discuss.elastic.co/t/set-username-and-password-for-kibana-without-using-xpack/133101 "2018-05-24T09:31:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![solo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/solo/32/29084_2.png) [@solo](https://discuss.elastic.co/u/solo)\
**Post date:** [May 24, 2018, 9:31am UTC](https://discuss.elastic.co/t/set-username-and-password-for-kibana-without-using-xpack/133101/1 "2018-05-24T09:31:43Z")

</div>

This is my setup:  
Kibana 6.2.4  
Elasticsearch 6.2.4  
Filebeat 6.2.4  
Logstash 6.2.4  
OS: Red Hat Linux

I am setting up a basic test environment for testing out the features in Kibana for my organization. I want to have a username and a password to login to Kibana with. How can I do this without installing Xpack? I don't want to use Xpack because it is not free.

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [May 24, 2018, 9:41am UTC](https://discuss.elastic.co/t/set-username-and-password-for-kibana-without-using-xpack/133101/2 "2018-05-24T09:41:15Z")

</div>

See here:

> **[Playing HTTP Tricks with Nginx
	  	 | Elastic](https://www.elastic.co/blog/playing-http-tricks-nginx)**
>
> Update November 2, 2015: If you're interested in advanced access control configuration or other security features, consider taking Shield, security for Elasticsearch, for a spin. One of the defining f...

  
Nginx supports basic access authentication out-of-the-box so do read on from `Basic Authentication` downwards in regards to using nginx for your needs.

---

<div class="post-metadata">

**Author:** ![solo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/solo/32/29084_2.png) [@solo](https://discuss.elastic.co/u/solo)\
**Post date:** [May 24, 2018, 11:06am UTC](https://discuss.elastic.co/t/set-username-and-password-for-kibana-without-using-xpack/133101/3 "2018-05-24T11:06:46Z")

</div>

This is what I have done:

```
sudo apt-get install nginx apache2-utils
sudo htpasswd -c /etc/nginx/htpasswd.users kibanaadmin

```

Then edit nginx config:

```
sudo nano /etc/nginx/sites-available/default

```

Config:

```
server {
  listen 80;
    server_name kibana;

  error_log /var/log/nginx/kibana.error.log;
  access_log /var/log/nginx/kibana.access.log;

  location / {
    rewrite ^/(.*) /$1 break;
    proxy_ignore_client_abort on;
    proxy_pass http://localhost:5601;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
   
  }
}

```

Then restart:  
`sudo service nginx restart`

But I can still access Kibana on [http://localhost:5601](http://localhost:5601) without password.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 21, 2018, 11:06am UTC](https://discuss.elastic.co/t/set-username-and-password-for-kibana-without-using-xpack/133101/4 "2018-06-21T11:06:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
