Now I have more understanding. The default username and password for OpenSearch are actually
username: kibanaserver
password: kibanaserver
instead of
username: admin
password: admin
I think the document need update.
Also, if you set different username and password and removed default username and password for OpenSearch, for OpenSearch Dashboards, you can pass
OPENSEARCH_USERNAME=xxx
OPENSEARCH_PASSWORD=xxx
as environments.
More info is at Waiting until all OpenSearch nodes are compatible with OpenSearch Dashboards before starting saved objects migrations - #2 by Hongbo-Miao