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 1qPO14-00ArSS-UC for pgsql-general@arkaria.postgresql.org; Fri, 28 Jul 2023 14:00:26 +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 1qPO13-00GNCd-Gw for pgsql-general@arkaria.postgresql.org; Fri, 28 Jul 2023 14:00:25 +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 1qPO13-00GNCV-65 for pgsql-general@lists.postgresql.org; Fri, 28 Jul 2023 14:00:25 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qPO10-00235p-LY for pgsql-general@lists.postgresql.org; Fri, 28 Jul 2023 14:00:23 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6b9ede6195cso1848036a34.3 for ; Fri, 28 Jul 2023 07:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690552821; x=1691157621; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=db/xxOMIi3yeKLZMNclry9XSqUEf9Z6EIzoLGCmIK4I=; b=XbY+hYJ7ojiT3ASuJxjgEyvkuLFJNTA5JFYAh0Adl3emOeE8w9ck+gOKDRhkyV/9Q9 4hZJLu43Z+pSlUpR8g2u1zKeXlZB6qbehPAjpFkIxfBzxiRiUopkbGWNYitCSPCyO5AE M57bDf3gK0i6T1OyHIjzpuK4haqx+dXU/C84cJBmgYoDDCIgtwlyugMJZ7KxDF0QBbR2 F4m9ssH5X3aurB5DkjrlAkdJ1VA7+hqlmw5itv7RZVTjeS1Dpac73uqUyg3kzXtKc6GW ALRgXqLZuBfp+bD6F/Xqyk6JSqab11D0pcMTXio1TzVV7Pfqb9GqTwrcl8YHSeKKVAxB VuCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690552821; x=1691157621; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=db/xxOMIi3yeKLZMNclry9XSqUEf9Z6EIzoLGCmIK4I=; b=VGjL9G60Z+GoUehXrlqmmGr8NC47nJdyn7PR4gr8oB/GwwHVg5WjlexE31s5o6dx5c lPfDJWsob94TwqZF2Cwz+YPTTKWTU0VmqCc5SyX9de+mPPq4SpTymifCuuTZNz9SX4so oQiIcIa3snFfYs+RmK26/v/5ey06a2o2Qd6XG7XUMeHwOmwU5bsGbF4smZL+xU0f4G6v Ntn/r9PI+1SGk18ig3UnanWCuzkOZt3YvVJXQr6P3wGWYKMLPy3C8xfCI3BcuXxW5RSD 38ckG66wGC0llTbQxjQKji+6Y5LysZ14ZOXbAOOknx9uu09AB1kwUJVLVkgvevdKE6eN DGPg== X-Gm-Message-State: ABy/qLZ/QCQZsKBE+FH+DLV3FpSnpSFN7SvGYBcqIlRffmUKsQKotVsM jTzUAG8bMDe7brXwp93DRnNp3dMGRjxfdQ== X-Google-Smtp-Source: APBJJlHGEoNXfFbq1M/2m+sGyGDvpgU2QhXOLh2tC3/KrLCUMt4PxFxGLbMRh7+biVz/h7m8ZEA+0w== X-Received: by 2002:a05:6358:441d:b0:135:47e8:76e2 with SMTP id z29-20020a056358441d00b0013547e876e2mr2624423rwc.4.1690552821270; Fri, 28 Jul 2023 07:00:21 -0700 (PDT) Received: from [192.168.2.170] ([67.70.150.114]) by smtp.gmail.com with ESMTPSA id g6-20020a05620a108600b0076c8fd39407sm241766qkk.113.2023.07.28.07.00.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 07:00:20 -0700 (PDT) From: Amn Ojee Uw X-Google-Original-From: Amn Ojee Uw Content-Type: multipart/alternative; boundary="------------sx9zOYs6WrRAK4PJpu4I0g9e" Message-ID: <30a777f8-59e0-ae68-4bf3-1715973a6c23@gmail.com> Date: Fri, 28 Jul 2023 10:00:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: PostgreSQL - How to login with my Linux user account Content-Language: en-US To: pgsql-general@lists.postgresql.org References: In-Reply-To: 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. --------------sx9zOYs6WrRAK4PJpu4I0g9e Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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'? Thanks in advance. On 7/27/23 8:19 p.m., Amn Ojee Uw wrote: > psql -d mydb -U myuser -W --------------sx9zOYs6WrRAK4PJpu4I0g9e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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'?


Thanks in advance.

On 7/27/23 8:19 p.m., Amn Ojee Uw wrote:
psql -d mydb -U myuser -W
--------------sx9zOYs6WrRAK4PJpu4I0g9e--