It sounds like your keystore (/etc/elasticsearch/elasticsearch.keystore) is owned by an Elasticsearch specific user (probably elasticsearch) and you are running /usr/share/elasticsearch/bin/elasticsearch-keystore as the root user.
You need to run /usr/share/elasticsearch/bin/elasticsearch-keystore as the same user as owns the /etc/elasticsearch/elasticsearch.keystore file.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.