Change/reset admin password

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cris00
    Member
    • Dec 2015
    • 73

    #1

    Change/reset admin password

    Hello!

    Thanks in advance for the answers! Quick question: how can I reset the admin password using phpmyadmin? I have tried to use ”Forgot password”, but it does now work (maybe because the email sending details have not been set).
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9605

    #2
    Hi

    Install new instance with admin password. Then copy passwordSalt from data/config.php to your instance. Then you can copy hashed password from from database.

    Comment


    • nunos
      nunos commented
      Editing a comment
      Hi yuri,

      I am having the same problem and i am a little newbie

      Can you explain how to do it step by step please?

      Thanks,

      Nuno
  • Cris00
    Member
    • Dec 2015
    • 73

    #3
    Originally posted by yurikuzn
    Hi

    Install new instance with admin password. Then copy passwordSalt from data/config.php to your instance. Then you can copy hashed password from from database.
    Thanks for the reply! Unfortunately, I am kind of a newbie.

    So, I am in phpmyadmin, under user table. I insert a new user and set him with 1 under is_admin. I put a password based on simple text, let us say ”pass”. But after that, where do I put the passwordSalt?

    Or where do I install the new instance?

    Sorry for not understanding.

    Comment

    • Cris00
      Member
      • Dec 2015
      • 73

      #4
      Originally posted by Cris00

      Thanks for the reply! Unfortunately, I am kind of a newbie.

      So, I am in phpmyadmin, under user table. I insert a new user and set him with 1 under is_admin. I put a password based on simple text, let us say ”pass”. But after that, where do I put the passwordSalt?

      Or where do I install the new instance?

      Sorry for not understanding.
      Hello, another question if you may. When I try you recover your password, it says Forbidden, try later. Is there a way to bypass this?

      Comment

      • Cris00
        Member
        • Dec 2015
        • 73

        #5
        Hello!

        I have finally got the answer.

        I installed ESPOcrm again in another directory, copied the passwordSalt from /data from the new install to the old one and copied the admin password from new install to the old install in the phpmyadmin.

        Comment

        • yuri
          EspoCRM product developer
          • Mar 2014
          • 9605

          #6
          Regarding Forbidden i'm not sure. Maybe change request was expired?

          Comment

          • Cris00
            Member
            • Dec 2015
            • 73

            #7
            Well, I do not know, but got it fixed how I mentioned aboved. Thanks again!

            Comment

            • telenieko
              Junior Member
              • Mar 2020
              • 9

              #8
              This post is the first result when searching about that issue, even now in 2020. So I post this here for anyone needing to reset the admin password:
              As stated in the documentation, since EspoCRM 5.8.3 it is possible to do so:

              Code:
              # where [username] is a user name, e.g. admin.
              php command.php SetPassword [username]

              Comment


              • czcpf
                czcpf commented
                Editing a comment
                When I try to run this this command it simply outputs
                Enter a new password:
                and returns the shell terminal, thus preventing the user from actually changing the password....
            • eelgani
              Junior Member
              • Nov 2021
              • 4

              #9
              How do you run the php command if EspoCRM was installed in Docker containers ( used the automated install script)? The php command isn't recognized in this case. Thanks.

              Comment


              • lazovic
                lazovic commented
                Editing a comment
                You can use the following command in CLI first:
                docker exec -it espocrm bash

                Thus, you actually find yourself in the EspoCRM root directory. Here you can run all the php commands.
            • esforim
              Active Community Member
              • Jan 2020
              • 2220

              #10
              Hi guys, I'm learning how to self-host and here is a tutorial for the future generation.

              How to Update Password (PUBLIC POSTING VERSION)
              Reference: https://forum.espocrm.com/forum/gene...admin-password
              Open Command Prompt (Start > cmd)
              Then use:
              1. C:\PHP\app\php-8.4.11
                1. This is the folder where my PHP is install
              2. php command.php SetPassword [username]
                1. Example:
                  1. php "D:\EspoCRM\command.php" SetPassword admin
                2. This is where my EspoCRM is install.
              3. You be asked to enter new password. For simplicity I just use admin again. Then try login in from EspoCRM GUI. Worked for me.

              Comment


              • esforim
                esforim commented
                Editing a comment
                But looking at how easy is this command, I'm afraid of my security. It offline server so it should be 'fine' but if I open this for remote access I need to learn about security as well.... but that is another chapter and maybe someone will post a tutorial.
            • yuri
              EspoCRM product developer
              • Mar 2014
              • 9605

              #11
              This command can only be run from CLI. Just need to make sure no one have access to CLI.

              Comment

              Working...