Skip to navigation
Bash script to update a couch db user password
13.09.23
```bash #!/bin/bash echo "Username: $1"; echo "Password: $2"; RET=$(curl -k -X GET https://admin:password@cb.neriene.com/_users/org.couchdb.user:$1) FIELD=$(cut -d , -f 2 <<< $RET) REV=$(cut -d : -f 2 <<< $FIELD | sed 's/"//g') echo $REV curl -X PUT https://admin:password@cb.neriene.com/_users/org.couchdb.user:$1 \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "If-Match: $REV" \ -d "{\"name\":\"$1\", \"roles\":[], \"type\":\"user\", \"password\":\"$2\"}" ```
https://docs.couchdb.org/en/stable/intro/security.html
Reply
Anonymous
Information Epoch 1732731837
Live free or die.
Home
Notebook
Contact us