Wednesday, November 30, 2011

How to change all password using curl in CQ / WEM (Till CQ5.4)


echo changing crx admin password:
curl --data rep:password=$NEW_PWD --user admin:admin http://$HOST:$PORT/home/users/a/admin

echo change cqse admin password:
curl --data username="admin" --data password_old=$OLD_PWD --data password=$NEW_PWD --data password_check=$NEW_PWD --user admin:admin http://$HOST:$PORT/admin/passwd

echo change replication agent password:
curl --data transportPassword=$NEW_PWD --user admin:$OLD_PWD http://$HOST:$PORT/etc/replication/

echo change sling crx client password:
echo below script does:
echo 1. find specific pid (needs
echo 2. set password property for that pid

PID=`curl -s -u admin:$CONSOLE_PWD "http://$HOST:$PORT/system/console/configMgr/(service.factoryPid=$FACTORY_PID).json" | jsawk -n 'out('`
echo ">> $PID"
curl -s -u admin:$CONSOLE_PWD -dapply=true -dadmin.password=$NEW_PWD -dpropertylist=admin.password http://$HOST/system/console/configMgr/$PID > /dev/null


Note: Have not tested it. Please test it before use.

Thanks Alexander Klimetschek from Adobe for this information.


  1. curl --data rep:password=$NEW_PWD --user admin:admin http://$HOST:$PORT/home/users/a/admin

    did not work for me; I instead used:

    curl --data plain=$NEW_PWD --data verify=$NEW_PWD --user admin:admin http://$HOST:$PORT/crx/ui/setpassword.jsp | grep 'Password'

    I also used Perl instead of jsawk for the client repository password change:

    PID=`curl -s -u admin:$CONSOLE_PWD "http://$HOST:$PORT/system/console/configMgr/(service.factoryPid=$FACTORY_PID).json" | perl -ne 'use JSON; $j = decode_json $_; print %{$j->[0]}->{"pid"}'`

    1. Thanks Jim for your feed back. It would be handled much better in next release by single CURL command. Will update this post as soon as it is released.

  2. Hi I tried to change the replication agent password for cq5.6 and it didnt work with the command posted:

    curl --data transportPassword=$NEW_PWD --user admin:$OLD_PWD http://$HOST:$PORT/etc/replication/


    1. Please make sure that it is the default agent you are using. If it is not default agent path could be different.

      Also what version of CQ are you using ?

  3. Replies
    1. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
      Cyber Security Projects for Final Year

      JavaScript Training in Chennai

      Project Centers in Chennai

      JavaScript Training in Chennai

  4. This software has been designed to work in a special way to help reset the password of your system in the simplest way possible.reset windows 10 password