Getting error when try to install kibana plugin

I’m trying to install “opendistro_security_kibana_plugin-1.8.0.0.zip” package for kibana.

I tried to install with sudo :

sudo bin/kibana-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-security/opendistro_security_kibana_plugin-1.8.0.0.zip

But I’m getting this error:

Kibana should not be run as root.  Use --allow-root to continue.

Then I try to install without sudo :

bin/kibana-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-security/opendistro_security_kibana_plugin-1.8.0.0.zip

Now, I’m getting this error:

Plugin installation was unsuccessful due to error "ENOENT: no such file or directory, mkdir"

I also try this two command :

  1. su -s /bin/bash -c 'bin/kibana-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-security/opendistro_security_kibana_plugin-1.8.0.0.zip'
  2. service kibana start 'bin/kibana-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-security/opendistro_security_kibana_plugin-1.8.0.0.zip'

But still installation is unsuccessful.

What is the solution?