Wednesday, October 28, 2015

Reset admin password in Alfresco 4.0.d

Reset admin password in Alfresco 4.0.d
Case1 : If you know the password of other user with admin role you can change directly by logging into the alfresco site

Case1 : Change admin password in postgres database

Login to alfresco instance and change directory to /opt/alfresco-4.0.d/postgresql/bin
# ./psql -U postgres
Password for user postgres:
postgres=#

To List databases
postgres=# \l
                                  List of databases
      Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+------------------------------------------------------


Connect to alfresco database
postgres=# \connect alfresco;
You are now connected to database "alfresco".
alfresco-#


Display tables
alfresco-# \dt

To list users and their passwords

alfresco-# SELECT anp1.node_id,
       anp1.qname_id,
       anp1.string_value as hash_pass,
       anp2.string_value as user_string
FROM alf_node_properties anp1
        INNER JOIN alf_qname aq1
           ON aq1.id       = anp1.qname_id
        INNER JOIN alf_node_properties anp2
           ON anp2.node_id = anp1.node_id
        INNER JOIN alf_qname aq2           
           ON aq2.id       = anp2.qname_id
WHERE aq1.local_name    = 'password'
AND aq2.local_name    = 'username';


 node_id | qname_id |            hash_pass             | user_string
---------+----------+----------------------------------+-------------
     555 |       10 | 0eeb8b5ee6e96f1a8443edfb1dfc36ad | mjackson
       4 |       10 | 50d4e7a47cf4a836e51cdbc335cb6f44 | admin

In alfresco passwords are stored as encrypted.

For 'admin' string the encrypted one is  209c6174da490caeb422f3fa5a7ae634 so we
Reset the password to admin and login to alfresco web and change password.
alfresco-# UPDATE alf_node_properties
 SET string_value='209c6174da490caeb422f3fa5a7ae634'
 WHERE
 node_id=4
 and
 qname_id=10
UPDATE 1

Queries copied from
http://keytocontent.blogspot.in/2011/09/resetting-forgotten-alfresco-admin.html





2 comments:

  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Postgresql Admin
    , kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on in Postgresql Admin We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us:
    Name : Arunkumar U
    Email : arun@maxmunus.com
    Skype id: training_maxmunus
    Contact No.-+91-9738507310
    Company Website –http://www.maxmunus.com


    ReplyDelete
  2. Hi,

    It was a nice post, after running the quiry i can able to see all the usernames and password but admin users is not present i have reset the password in admin password after restart of alfresco i can't able to login the dashboard can you please help me on this

    Regards
    Noor Ahmed

    ReplyDelete