Kibana error: security_exception: [security_exception] Reason: unable to authenticate with provided credentials and anonymous access is not allowed for this request

I solved this.
After resetting passwords in elasticsearch, I restarted Logstash, Kibana, Elasticsearch.
But I still got this error.
Then I generated the new keys like here: kibana encryption keys

Command:
./bin/kibana-encryprion-keys generate --force

I copied newly generated keys to

xpack.security.encryptionKey: "myKey"
xpack.encryptedSavedObjects.encryptionKey: "myEncKey"
xpack.reporting.encryptionKey: "my2EncKey"

Then I solve the Encryption API Key Problem here: encryption API