CouchDB create a server admin via script CouchDB create a server admin via script curl curl

CouchDB create a server admin via script


According to the documentation, you can create a new admin via the REST API by working with the _config endpoint.

By issuing a PUT request against /_config/admins/:username (where the request body is the password) a new admin will be created. (provided you have access to do so)

Futon is just using $.couch.config({...ajax options...}, "admins", username, password); to accomplish this.


As per http://guide.couchdb.org/draft/security.html, you can use something like:

$ curl -X PUT localhost:5984/_config/admins/myusername -d '"mypassword"'