ok, still getting same security_exception:
# ES_PWD=changeme
# filebeat enroll https://X.X.X:443 --username elastic --password env:ES_PWD
Error creating a new enrollment token: [security_exception] failed to authenticate user [elastic], with { header={ WWW-Authenticate="Basic realm=\"security\" charset=\"UTF-8\"" } }
# curl -s -I https://elastic:$ES_PWD@X.X.X:443 | grep ^HTTP
HTTP/1.1 200 OK
#
yet, following works as expected:
# filebeat enroll https://X.X.X:443 --username elastic --password stdin
Enter password:
This will replace your current settings. Do you want to continue? [Y/n]:y
Saving a copy of current settings to /etc/filebeat/filebeat.yml.bak
Enrolled and ready to retrieve settings from Kibana
#