Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzj3t-0005UF-JY for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2019 14:55:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hzj3s-0003ML-BE for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2019 14:55:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzj3r-0003ME-Uk for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2019 14:55:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hzj3p-0002tG-Oj for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2019 14:55:06 +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 x7JEt465022804; Mon, 19 Aug 2019 10:55:04 -0400 From: Tom Lane To: stan cc: pgsql-general@lists.postgresql.org Subject: Re: Sorry, real newbie question about connecting to a database In-reply-to: <20190819144445.GA7984@panix.com> References: <20190819144445.GA7984@panix.com> Comments: In-reply-to stan message dated "Mon, 19 Aug 2019 10:44:45 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22802.1566226504.1@sss.pgh.pa.us> Date: Mon, 19 Aug 2019 10:55:04 -0400 Message-ID: <22803.1566226504@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk stan writes: > But I cannot conect, or swith to user > employee: > stan@smokey:/etc/postgresql/11/main$ psql -U employee > psql: FATAL: Peer authentication failed for user "employee" This means that you've set pg_hba.conf to specify "peer" authentication, which by default only lets you connect as a PG role named the same as your OS account. (This is about are-you-who-you-say-you-are; whether who-you-say-you-are has privilege to connect is independent.) You could use some other auth method, or you could set up a mapping file that says you (stan) are allowed to connect as "employee". regards, tom lane