Changing password of postfix user account directly in MySQL database

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.



Here is the table:



SELECT username,password FROM mailbox LIMIT 1;
+------------------+------------------------------------+
| username | password |
+------------------+------------------------------------+
| user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
+------------------+------------------------------------+


What format is it? How to change it?










share|improve this question



























    up vote
    3
    down vote

    favorite












    I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.



    Here is the table:



    SELECT username,password FROM mailbox LIMIT 1;
    +------------------+------------------------------------+
    | username | password |
    +------------------+------------------------------------+
    | user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
    +------------------+------------------------------------+


    What format is it? How to change it?










    share|improve this question

























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.



      Here is the table:



      SELECT username,password FROM mailbox LIMIT 1;
      +------------------+------------------------------------+
      | username | password |
      +------------------+------------------------------------+
      | user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
      +------------------+------------------------------------+


      What format is it? How to change it?










      share|improve this question















      I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.



      Here is the table:



      SELECT username,password FROM mailbox LIMIT 1;
      +------------------+------------------------------------+
      | username | password |
      +------------------+------------------------------------+
      | user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
      +------------------+------------------------------------+


      What format is it? How to change it?







      mysql postfix






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 8 at 9:11

























      asked May 26 '17 at 19:43









      Rui F Ribeiro

      38.1k1475123




      38.1k1475123




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          The $1$ at the beginning of the password field hints it is a MD5 hash.



          To encrypt a password in a MD5 hash, you can use the openssl passwd command.



          From man openssl:




          passwd Generation of hashed passwords.




          and from openssl passwd --help:




          -1 MD5-based password algorithm

          -stdin read passwords from stdin




          So to generate the MD5 hash, a short bash example:



          #/bin/bash
          PASSWORD="test123"
          MD5=`echo $PASSWORD | openssl passwd -1 -stdin`


          Running it, you got as output the intended encrypted password:



          $1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/


          So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:



          USE postfix
          UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";



          The change takes effect immediately, and the user will notice the change in the next mailbox access.






          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f367480%2fchanging-password-of-postfix-user-account-directly-in-mysql-database%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            The $1$ at the beginning of the password field hints it is a MD5 hash.



            To encrypt a password in a MD5 hash, you can use the openssl passwd command.



            From man openssl:




            passwd Generation of hashed passwords.




            and from openssl passwd --help:




            -1 MD5-based password algorithm

            -stdin read passwords from stdin




            So to generate the MD5 hash, a short bash example:



            #/bin/bash
            PASSWORD="test123"
            MD5=`echo $PASSWORD | openssl passwd -1 -stdin`


            Running it, you got as output the intended encrypted password:



            $1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/


            So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:



            USE postfix
            UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";



            The change takes effect immediately, and the user will notice the change in the next mailbox access.






            share|improve this answer


























              up vote
              3
              down vote



              accepted










              The $1$ at the beginning of the password field hints it is a MD5 hash.



              To encrypt a password in a MD5 hash, you can use the openssl passwd command.



              From man openssl:




              passwd Generation of hashed passwords.




              and from openssl passwd --help:




              -1 MD5-based password algorithm

              -stdin read passwords from stdin




              So to generate the MD5 hash, a short bash example:



              #/bin/bash
              PASSWORD="test123"
              MD5=`echo $PASSWORD | openssl passwd -1 -stdin`


              Running it, you got as output the intended encrypted password:



              $1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/


              So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:



              USE postfix
              UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";



              The change takes effect immediately, and the user will notice the change in the next mailbox access.






              share|improve this answer
























                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                The $1$ at the beginning of the password field hints it is a MD5 hash.



                To encrypt a password in a MD5 hash, you can use the openssl passwd command.



                From man openssl:




                passwd Generation of hashed passwords.




                and from openssl passwd --help:




                -1 MD5-based password algorithm

                -stdin read passwords from stdin




                So to generate the MD5 hash, a short bash example:



                #/bin/bash
                PASSWORD="test123"
                MD5=`echo $PASSWORD | openssl passwd -1 -stdin`


                Running it, you got as output the intended encrypted password:



                $1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/


                So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:



                USE postfix
                UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";



                The change takes effect immediately, and the user will notice the change in the next mailbox access.






                share|improve this answer














                The $1$ at the beginning of the password field hints it is a MD5 hash.



                To encrypt a password in a MD5 hash, you can use the openssl passwd command.



                From man openssl:




                passwd Generation of hashed passwords.




                and from openssl passwd --help:




                -1 MD5-based password algorithm

                -stdin read passwords from stdin




                So to generate the MD5 hash, a short bash example:



                #/bin/bash
                PASSWORD="test123"
                MD5=`echo $PASSWORD | openssl passwd -1 -stdin`


                Running it, you got as output the intended encrypted password:



                $1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/


                So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:



                USE postfix
                UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";



                The change takes effect immediately, and the user will notice the change in the next mailbox access.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered May 26 '17 at 19:43









                Rui F Ribeiro

                38.1k1475123




                38.1k1475123



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f367480%2fchanging-password-of-postfix-user-account-directly-in-mysql-database%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay