Security On opensearch

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

Open search 2.10

Describe the issue:
Added security to opensearch, its considering by default username as admin and pwd as admin, not able to change that in the configuration

Configuration:

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: opensearch
spec:
  serviceName: "opensearch"
  replicas: 1
  selector:
    matchLabels:
      app: opensearch
  template:
    metadata:
      labels:
        app: opensearch
    spec:
      securityContext:
        runAsUser: 1000
        fsGroup: 1000
      containers:
      - name: opensearch
        image: opensearchproject/opensearch:2.10.0
        env:
        - name: OPENSEARCH_JAVA_OPTS
          value: "-Xms2g -Xmx2g"
        - name: node.name
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: cluster.name
          value: opensearch-cluster
        - name: node.name
          value: opensearch
        - name: discovery.seed_hosts
          value: opensearch
        - name: cluster.initial_cluster_manager_nodes
          value: opensearch
        - name: JAVA_HOME
          value: /usr/share/opensearch/jdk
        - name: DISABLE_SECURITY_PLUGIN
          value: "false"
        - name: plugins.security.restapi.roles_enabled
          value: all_access, security_rest_api_access
        ports:
        - containerPort: 9200
          name: http
        - containerPort: 9300
          name: transport
        volumeMounts:
        - name: config
          mountPath: /usr/share/opensearch/config/opensearch-security/config.yml
          subPath: config.yml
        - name: roles
          mountPath: /usr/share/opensearch/config/opensearch-security/roles.yml
          subPath: roles.yml
        - name: rolemap
          mountPath: /usr/share/opensearch/config/opensearch-security/roles_mapping.yml
          subPath: roles_mapping.yml
        - name: opensearch-data
          mountPath: /usr/share/opensearch/data
      volumes:
      - name: config
        configMap:
          name: opensearch-config
      - name: rolemap
        configMap:
          name: rolemap-config
      - name: roles
        configMap:
          name: role-config
      - name: opensearch-data
        persistentVolumeClaim:
          claimName: opensearch-pvc
---

Relevant Logs or Screenshots:
But not able to change the pwd of opensearch after modifying the config file could you please suggest how can we change the default pwd

@Sarala The admin password can be changed only by securityadmin.sh script.

Hi @pablo,
Trying to change the password for admin but not sure how to move forward any idea? how to change the default password for opensearch adn opensearch-dashboard for Kubernetes manifests?