Announcement

Collapse
No announcement yet.

reset admin password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • reset admin password

    Hey, I'm taking over a development environment that someone else (now sacked) has left.
    But he changed the default admin/admin login credentials.

    So question is how I reset these,, I have DB access of course..

    What algorithm is used? So I can generate a new password...

    Or how do I reset it with some other tool?

  • #2
    You can look at the default insert statement done in the *-database.sql files included with Mirth Connect for each database. Using the value inserted there, you could reset it back to admin, then use the Mirth Connect Administrator to change it to something more secure.
    Jacob Brauer
    Director, Software Development
    NextGen Healthcare

    sigpic

    Comment


    • #3
      admin password reset

      This does not work...I have tried entering in the string from the derby.database.sql file and after completion and mirth restart I still can't login. Here is what I ran to change reset the password to "admin"

      java -cp derbytools.jar:derby.jar org.apache.derby.tools.ij
      ij version 10.2
      ij> connect 'jdbc:derby:/apps/Mirth/mirthdb';
      ij> INSERT IGNORE INTO PERSON (USERNAME, PASSWORD, SALT, LOGGED_IN) VALUES('admin', 'NdgB6ojoGB/uFa5amMEyBNG16mE=', 'Np+FZYzu4M0=', 0);
      1 row inserted/updated/deleted
      ij> exit;

      Comment


      • #4
        Reset Mirth admin user password in latest Mirth Server on Windows

        1. Stop Mirth server
        2. cd to C:\Program Files\Mirth Connect\lib
        3. C:\Program Files\Mirth Connect\lib>java -cp derbytools-10.8.2.2.jar;derby-10.8.2.2.jar org.apache.derby.tools.ij
        4. connect 'jdbc:derby:C:/Program Files/Mirth Connect/Mirthdb';
        5. select * from person; -- find ID of Admin user, usually it will be 1
        6. update person_password set password='SALT_Np+FZYzu4M0=NdgB6ojoGb/uFa5amMEyBNG16mE=' WHERE person_id=1

        These steps worked for me..

        Comment


        • #5
          reset mirth password for LINUX

          Update: this is slightly different for Linux users but makes all the difference

          1)cd /opt/mirthconnect/lib

          2)sudo java -cp /opt/mirthconnect/lib/derbytools-10.8.2.2.jar:/opt/mirthconnect/lib/derby-10.8.2.2.jar org.apache.derby.tools.ij
          2-1)[sudo] password for xxxxx: [Enter SUDO password] ******

          3)connect 'jdbc:derby:/opt/mirthconnect/mirthdb/';

          4)select * from person;

          5)update person_password set password='SALT_Np+FZYzu4M0=NdgB6ojoGb/uFa5amMEyBNG16mE=' WHERE person_id=1;

          6)select * from person_password;

          Comment


          • #6
            Short update on this, this command will work. Few issues with newer versions, and basically the paths and files need to be changed to suit your install.

            1) You must be in a administrator cmd prompt. cd to C:\Program Files\Mirth Connect\server-lib\database

            2) run this: java -cp derbytools-10.10.2.0.jar;derby-10.10.2.0.jar org.apache.derby.tools.ij

            3) SHUT DOWN MIRTH SERVICE - this disconnects the DB.

            4) connect 'jdbc:derby:C:\Program Files\Mirth Connect\appdata\mirthdb';
            5) select id, username from person; -- note person_id - should be 1
            6) select password from person_password where person_id=1; -- shows previous password, write this down.
            7) update person_password set password='SALT_Np+FZYzu4M0=NdgB6ojoGb/uFa5amMEyBNG16mE=' WHERE person_id=1;
            8) quit;
            9) Start Mirth.

            If you are having issues with read only db, it's because the command prompt is not elevated. If you are having issues starting mirth, it's bc you have the db open already (you did not quit.

            Comment


            • #7
              Trying to reset password on 3.5

              I have a Mirth instance that appears to have just lost its users - we had 3 user accounts on it last week, and now we have only admin. The admin password, however, was apparently not admin, so I'm currently trying to reset it. I've read through 6 threads now and tried both of the hashes that are commonly listed, but I'm still not able to login. The steps I've tried:
              1) cd "C:\Program Files\Mirth Connect\server-lib\database"
              2) java -cp derbytools-10.10.2.0.jar;derby-10.10.2.0.jar org.apache.derby.tools.ij
              3) Stop Mirth Service
              4) connect 'jdbc:derby:C:/Program Files/Mirth Connect/appdata/Mirthdb';
              5a) Old Hash:
              update person_password set password = 'YzKZIAnbQ5m+3llggrZvNtf5fg69yX7pAplfYg0Dngn/fESH93OktQ==' where person_id = 1;
              5b) New Hash:
              update person_password set password='SALT_Np+FZYzu4M0=NdgB6ojoGb/uFa5amMEyBNG16mE=' WHERE person_id=1;
              6) Start Mirth Service, login as admin/admin

              I've verified each time that person_password was updated, and person_id = 1 is definitely admin. I don't see any encryption or digest settings in mirth.properties. Thoughts? Is there a new hash for 3.5, perhaps? Did I miss a key step or attribute?

              Edit: I realized that the database was set to use postgres. I opened psql, found all of our users in the person table, and updated my password with the old hash, worked beautifully. I didn't even have to restart Mirth. Just an FYI for anyone using postgres instead of the default derby database. To echo narupley, make sure you're using the database you think you are using.
              Last edited by Scott Adair; 09-11-2018, 07:44 AM.

              Comment


              • #8
                What encryption are we using for the password here?

                Comment


                • #9
                  What encryption is used to store password in PostgreSQL ?

                  Originally posted by ezinteropsolutions View Post
                  What encryption are we using for the password here?
                  I would like to know the answer to this question too. Anyone ?

                  Comment


                  • #10
                    Originally posted by iamonkara View Post
                    I would like to know the answer to this question too. Anyone ?
                    The default digest algorithm used for hashed passwords is SHA-256, but can be changed with the "digest.algorithm" setting in mirth.properties. A random 8-byte salt is also used in the hash and stored alongside the password in the database.
                    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

                    Nicholas Rupley
                    Work: 949-237-6069
                    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


                    - How do I foo?
                    - You just bar.

                    Comment


                    • #11
                      @narupley could you please point to the code where the salt and digest code to encrypt the password is. The reason I ask is I am trying to use this guide Postgres https://www.postgresql.org/docs/12/pgcrypto.html to create a more than 40 length password (Mirth Administrator doesn't allow more than 40 char) and using that guide I am unable to login with the password I directly entered in DB


                      Originally posted by narupley View Post
                      The default digest algorithm used for hashed passwords is SHA-256, but can be changed with the "digest.algorithm" setting in mirth.properties. A random 8-byte salt is also used in the hash and stored alongside the password in the database.

                      Comment


                      • #12
                        reset admin password mirth connect administrator

                        hi, trying to follow advice to reset password but my linux install doesn't look like it has the database directory

                        this is 3.5.0.8232

                        thank you

                        ~$ ls -lrt /usr/local/mirthconnect/
                        total 240
                        -rwx------ 1 root root 13540 Apr 18 2017 uninstall
                        -rw-r--r-- 1 root root 8328 Apr 18 2017 mirth-server-launcher.jar
                        -rw-r--r-- 1 root root 78882 Apr 18 2017 mirth-manager-launcher.jar
                        -rw-r--r-- 1 root root 5375 Apr 18 2017 mirth-cli-launcher.jar
                        -rw-r--r-- 1 root root 69 Apr 18 2017 mcservice.vmoptions
                        -rwxr-xr-x 1 root root 16200 Apr 18 2017 mcservice
                        -rw-r--r-- 1 root root 69 Apr 18 2017 mcserver.vmoptions
                        -rwxr-xr-x 1 root root 12973 Apr 18 2017 mcserver
                        -rwxr-xr-x 1 root root 12963 Apr 18 2017 mcmanager
                        -rwxr-xr-x 1 root root 12967 Apr 18 2017 mccommand
                        drwxr-xr-x 2 root root 4096 Apr 18 2017 custom-lib
                        drwxr-xr-x 2 root root 4096 Jul 9 2017 manager-lib
                        drwxr-xr-x 2 root root 4096 Jul 9 2017 cli-lib
                        drwxr-xr-x 2 root root 4096 Jul 9 2017 client-lib
                        drwxr-xr-x 2 root root 4096 Jul 9 2017 conf
                        drwxr-xr-x 4 root root 4096 Jul 9 2017 docs
                        drwxr-xr-x 43 root root 4096 Jul 9 2017 extensions
                        drwxr-xr-x 7 root root 4096 Jul 9 2017 public_api_html
                        drwxr-xr-x 5 root root 4096 Jul 9 2017 public_html
                        drwxr-xr-x 10 root root 4096 Jul 9 2017 server-lib
                        drwxr-xr-x 2 root root 4096 Jul 9 2017 webapps
                        -rwxr-xr-x 1 root root 218 Jul 9 2017 Mirth Connect Server Manager.desktop
                        -rw-r--r-- 1 root root 624 Jul 9 2017 preferences
                        [/FONT]

                        Comment

                        Working...
                        X