How do I run securityadmin.sh?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 3.1.0

Describe the issue: can’t seem to find java
#./securityadmin.sh -h
/usr/bin/which: no java in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
WARNING: nor OPENSEARCH_JAVA_HOME nor JAVA_HOME is set, will use
./securityadmin.sh: line 29: java: command not found

Configuration:opensearch 3.1.0 on VM with Oracle Linux 8.10 STIG

Relevant Logs or Screenshots:

I tried setting OPENSEARCH_JAVA_HOME=/usr/share/opensearch/jdk and it still does not work
./securityadmin.sh: line 29: /usr/share/opensearch/jdk/lib/bin/java: No such file or directory

@danrk How are you deploying OS? Is it using binary or docker maybe?

updated the initial post, it is a VM and installing from rpm

@danrk I tested with centOS using:

export OPENSEARCH_JAVA_HOME=/usr/share/opensearch/jdk

and it works as expected. Do you see OPENSEARCH_JAVA_HOME in envars?

1 Like

ok, I have the variable set, now I get this when I try to run securityadmin.sh
/usr/share/opensearch/jdk/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

Hey @danrk

what do you see when executing this?

update-alternatives --config java

no output

securityadmin.sh runs in a non-STIG OL8.

/usr/share/opensearch/plugins/opensearch-security/tools/securityadmin.sh
-cacert /etc/opensearch/root-ca.pem
-cert /etc/opensearch/admin.pem
-key /etc/opensearch/admin-key.pem
-cd /etc/opensearch/opensearch-security
-h os3v2
-f /etc/opensearch/opensearch-security/internal_users.yml

it works by setting fapolicy permissive =1, restart fapolicyd