I'm running through a basic install on a Ubuntu server 20.04 VM. I'm able to get ES installed with no trouble, but am having some issues when I start working through setting up security and encryption.
Specifically I'm having an issue using the elasticsearch-keystore tool to create the file or add/remove settings from it. It seems like I'm having an issue at the file system level as it appears to be choking on accessing the /etc/elasticsearch directory.
/usr/share/elasticsearch$ ./bin/elasticsearch-keystore list
./bin/elasticsearch-env: line 75: /etc/default/elasticsearch: Permission denied
I'm logged in as a non-root user. My default when I get a Permission denied is to rerun with sudo...
/usr/share/elasticsearch$ sudo ./bin/elasticsearch-keystore list
But as soon as I try to add a setting by running with sudo I get a message that elasticsearch should not be run as root. Also documentation suggests I should be running the keystore tool as the same user that will be running elasticsearch.
Digging in the elasticsearch.service file shows that it will be running as the elasticsearch user, so I started trying to figure out if I can run the keystore tool as that user, but haven't been able to get that to work successfully either. This led me to the discussion forums and it looks like nobody that's talking about the keystore tool is mentioning having to do anything with the user to get it to work. This makes me believe I'm doing something fundamentally wrong.