Change Solr password with cURL

To enable Solr password authentication create the following file:
/var/solr/data/security.json
(The path may be different on your system!)

{"authentication":{"blockUnknown":true,"class":"solr.BasicAuthPlugin","credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},"":{"v":0}}}

Next run this cURL command:
Replace the „XXX“ by your new password.

curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -X POST -d '{"set-user": {"solr" : "XXXXXXXX"}}'