Menu

pg_hba.conf edit privilege? password postgres

Help
Sean S.
2008-03-16
2012-08-31
  • Sean S.

    Sean S. - 2008-03-16

    I just installed the PostgreSQL package and its nice but how can i edit the pg_hba.conf file. It seemes to be owned by the postgres user which i assume the install package created...but what is the password?

     
    • Alain Viret

      Alain Viret - 2008-03-17

      With your admin account, you may change this password or you may also use sudo to edit this file.

       
      • Sean S.

        Sean S. - 2008-03-17

        I am logged in as the admin but i still cannot go into the data directory to edit the .conf file.

         
        • Alain Viret

          Alain Viret - 2008-03-17

          The file is maybe write protected. Are your using vi ? You may force the write protection with "!w" when editing the file.
          You may also use "su - postgres" so, to get access to the file with a terminal.

          Hope this helps

           
          • Sean S.

            Sean S. - 2008-03-17

            yeah i initially tried "su postgres" but it asks for a password which i have no idea what it could be...i tried all my passwords with no success.

             
            • Alain Viret

              Alain Viret - 2008-03-17

              You have two ways:
              1- If you are asked for a password, you may overwrite it with the user account system preference.
              2- Before you "su - postgres", use "sudo bash" so you will be root, then "su - postgres" will not ask you a password.

               
              • Sean S.

                Sean S. - 2008-03-17

                aha, sudo bash did the trick!

                Thanks Alain!

                 

Log in to post a comment.

MongoDB Logo MongoDB