Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1douQi-0003Zn-96 for pgsql-admin@arkaria.postgresql.org; Mon, 04 Sep 2017 16:40:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1douQh-0002Ng-KC for pgsql-admin@arkaria.postgresql.org; Mon, 04 Sep 2017 16:40:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1douQg-0002Mv-QS for pgsql-admin@postgresql.org; Mon, 04 Sep 2017 16:40:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1douQZ-0008N9-Ur for pgsql-admin@postgresql.org; Mon, 04 Sep 2017 16:40:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v84GejtI003360; Mon, 4 Sep 2017 12:40:45 -0400 From: Tom Lane To: tirveni yadav cc: Ramesh , pgsql-admin@postgresql.org Subject: Re: New to postgreSQL In-reply-to: References: Comments: In-reply-to tirveni yadav message dated "Mon, 04 Sep 2017 21:38:19 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3358.1504543245.1@sss.pgh.pa.us> Date: Mon, 04 Sep 2017 12:40:45 -0400 Message-ID: <3359.1504543245@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org tirveni yadav writes: > On Mon, Sep 4, 2017 at 7:41 PM, Ramesh wrote: >> [postgres@localhost ~]$ createuser mytest >> Password: >> createuser: could not connect to database postgres: FATAL: password >> authentication failed for user "postgres" > This could be due to enabling md5 authentication for user postgres. > And password not yet set up for the user postgres. On most Linux distros, the default setup is that the postgres database user has no password --- if it did, everybody and his brother would try that password first if they wanted to break into a database :-(. Rather, it's typically set up so that if you are logged in as the operating system's postgres user, as Ramesh seems to be, it will let you in automatically based on peer authentication. So it's not clear why that's not working. Looking at the pg_hba.conf file to see what the actual authentication setup is would be a good thing. One idea is that there's a PGHOST environment variable setting that is affecting how createuser thinks it should connect. Peer auth only works when you come in through a Unix socket. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin