sugarcrmsuitecrm

How to change an user password with SQL on SuiteCRM?


Previously in SugarCRM, the following statement was enough:

UPDATE users SET user_hash = MD5('PASSWORD') WHERE user_name = 'USERNAME';

I can't find a single site on how to do it now with SuiteCRM?


Solution

  • I found this:

    Can I still use MD5 passwords? I’m used to that and can easily administer passwords in the database using just MD5.

    Sugar will still recognize passwords stored in MD5 format, but anytime a password is changed it will convert to the newer format. Unless very old PHP build (5.2) used in a system where better crypt() is not available, new password will use salted hashing algorithm.

    Posted it on SugarCRM's site:

    https://developer.sugarcrm.com/2012/05/16/new-for-sugar-6-5-stronger-password-storage-encryption/

    It turns out that SuiteCRM uses this new password format too, but, as well, it still recognizes md5 passwords, so, same sql statement works:

    UPDATE users SET user_hash = MD5('PASSWORD') WHERE user_name = 'USERNAME';
    

    I did it and it works :)

    Btw, same post recommends change passwords with PHP crypt like this:

    crypt(md5("newpassword"))
    

    Maybe it can help someone else.