Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPOhw-00AtaQ-71 for pgsql-general@arkaria.postgresql.org; Fri, 28 Jul 2023 14:44:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qPOhu-00GiWH-Ec for pgsql-general@arkaria.postgresql.org; Fri, 28 Jul 2023 14:44:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPOhu-00GiW6-4B for pgsql-general@lists.postgresql.org; Fri, 28 Jul 2023 14:44:42 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qPOhr-0023Yg-3i for pgsql-general@lists.postgresql.org; Fri, 28 Jul 2023 14:44:40 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-5839f38342fso22386207b3.0 for ; Fri, 28 Jul 2023 07:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690555478; x=1691160278; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=VF0bd72i0zjD53s/qT4OVHXVxPlcIU8wcqj/u0oAUDU=; b=Dm4BTigmqr3fR9lfPlbTRq42mvrQxmeiT9L1ieU1aJ2ABNVy07XycQ6BdeJ9/LU5o2 kHChPgR52F8b1GXHS0Jf6A8bKBmwtUIK4HIilGEbAYn7u2KJOPye/97bzUDVTXVDiZ04 dl2VYIyMU3SH+1AaFfZhmbgtV2iUxWERy8qeYpHx0VzJctiZdOvOuTRIo62GBRlExm0f refqtQxTr4p7RhwvBmYSfFwpNjiC1UOQhkMd6CJpaJnQGsi5qOqkQ3RBbCYdEMt8f3WH rchx13Vjhb692xUkUqXWQ176EeMSWlfpWpDSX9jvT0L9RwPGnUrbDYQgDzvWr1eihZsf RIkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690555478; x=1691160278; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=VF0bd72i0zjD53s/qT4OVHXVxPlcIU8wcqj/u0oAUDU=; b=hHAeOOpuYmsXUTbBaoXCoYYq+gwirn5yOqTparD7fhTKINS0XAxB4R/Gqb6g3e7Ed/ g4sZRjgM80je+hw71zuh4EneMXm4rVWWI7yPJy6n1OngStcuwQbVmIIdBYc8VKOCPhiE RuvJAe2cCqs297p5i3OOsEDg1XYrPTS5HK9sMM44b/dK5lYL2pTmynqrl8H1+kbTuPBt fPDSYfM3lIg9awYpdgbwl+NlfKNiVOahunzusiuuqjwOm9TPVNl2dx4zueoR48GWdDMF 3M1stTvT+Nx9HX3uJ9hHmnIiDZs0UklH3XLvi767aWq7zUgsMc0T2u6NM1jZLHfNwzab 4d1Q== X-Gm-Message-State: ABy/qLYqKJXBagyz/YnGBu1Oh3MxKw6kqWekY4OpAryQCebF55EoKKk+ pPH6vunN+jsrzyBED8cLLCl+cD+esBE= X-Google-Smtp-Source: APBJJlE6wAG2kaUlErmvpqwwX1Pje9x5PPAb52XSGNLqfyVtREK9cBtGWWrXiQ7T2U6s7BQ5oaSD0A== X-Received: by 2002:a81:6ac2:0:b0:56d:5a2:89ff with SMTP id f185-20020a816ac2000000b0056d05a289ffmr2642757ywc.33.1690555477737; Fri, 28 Jul 2023 07:44:37 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:c11c:5df6:9acb:ecd1? ([2600:1700:bd2c:b810:c11c:5df6:9acb:ecd1]) by smtp.googlemail.com with ESMTPSA id i3-20020a815403000000b00576c727498dsm1096478ywb.92.2023.07.28.07.44.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 07:44:37 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------EFitiODwJgwxoWG5Rv10Nqmk" Message-ID: Date: Fri, 28 Jul 2023 09:44:37 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: PostgreSQL - How to login with my Linux user account Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <30a777f8-59e0-ae68-4bf3-1715973a6c23@gmail.com> From: Ron In-Reply-To: <30a777f8-59e0-ae68-4bf3-1715973a6c23@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------EFitiODwJgwxoWG5Rv10Nqmk Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/28/23 09:00, Amn Ojee Uw wrote: > > First of all, my gratitude to Adrian and David for taking the time to > reply to my call for help; a 1k  thanks to you kids. > > Having stated the above, PostgreSQL provides a default database namely > 'postgres'. Taking advantage of this service, I have change the 'psql' > statement to 'psql -d postgres -U my_linux_user_name -W', I then entered > my Linux account login password and got this error messages : > /*$ psql -d postgres -U my_linux_user_name -W *//* > *//*Password: *//* > *//*psql: error: connection to server on socket > "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  Peer authentication > failed for user "my_linux_user_name"*/ > > I also, using 'postres' account, have created another user account, > chispa, who is a superuser; when trying to login as 'chispa' and using the > above statement (/*psql -d postgres -U chispa -W *//*)*/ PostgreSQL throws > the same error message. > /**/ > > What am I doing wrong? > Is there a webpage that explains how to login to PostgreSQL as other than > 'postgres'? > https://www.postgresql.org/docs/12/auth-pg-hba-conf.html You want peer authentication to be able to connect to postgresql as my_linux_username. -- Born in Arizona, moved to Babylonia. --------------EFitiODwJgwxoWG5Rv10Nqmk Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 7/28/23 09:00, Amn Ojee Uw wrote:

First of all, my gratitude to Adrian and David for taking the time to reply to my call for help; a 1k  thanks to you kids.

Having stated the above, PostgreSQL provides a default database namely 'postgres'. Taking advantage of this service, I have change the 'psql' statement to 'psql -d postgres -U my_linux_user_name -W', I then entered my Linux account login password and got this error messages :
$ psql -d postgres -U my_linux_user_name -W
Password:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  Peer authentication failed for user "my_linux_user_name"

I also, using 'postres' account, have created another user account, chispa, who is a superuser; when trying to login as 'chispa' and using the above statement (psql -d postgres -U chispa -W ) PostgreSQL throws the same error message.

What am I doing wrong?
Is there a webpage that explains how to login to PostgreSQL as other than 'postgres'?


https://www.postgresql.org/docs/12/auth-pg-hba-conf.html

You want peer authentication to be able to connect to postgresql as my_linux_username.

--
Born in Arizona, moved to Babylonia.
--------------EFitiODwJgwxoWG5Rv10Nqmk--