Fwd: How to connect PostgreSQL (9.6.17) database from Macbook Pro Terminal using JumpCloud password?

From: Devraj B <drb3644(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Fwd: How to connect PostgreSQL (9.6.17) database from Macbook Pro Terminal using JumpCloud password?
Date: 2020-07-16 19:04:13
Message-ID: CACL8z1SzCdYuf2=C-zLFH=z3BuX65iWnMspUOatyjTTDy9ozDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-novice

I login to my Macbook Pro using my JumpCloud password. My userid is
firstname.lastname
/Users/firstname.lastname > whoami
firstname.lastname

After connecting to VPN, from my Macbook Pro Terminal, I connect to
PostgreSQL server staging.mycompany.com having CentOS 6.10
/Users/firstname.lastname > ssh staging.mycompany.com
[firstname(dot)lastname(at)staging] $

Than I connect to root using my JumpCloud password
[firstname(dot)lastname(at)staging] $ sudo su -
[sudo] password for firstname.lastname: < I enter my JumpCloud Password
here >
[root(at)staging] #
(Above, I could connect to root using my JumpCloud Password. I don't know
what setup would have been done for that.)

Checked the O/S
[root(at)staging] # uname -a
Linux staging.local 2.6.32-696.16.1.el6.x86_64 #1 SMP Wed Nov 15 16:51:15
UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root(at)staging] # lsb_release -d | awk -F"\t" '{print $2}'
CentOS release 6.10 (Final)

Connected to PostgreSQL (9.6.17) to create a user exactly SAME as of my
Macbook Pro (or JumpCloud) username.
[root(at)staging] # psql -h localhost -U postgres
postgres=#
postgres=# select version();
PostgreSQL 9.6.17 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7
20120313 (Red Hat 4.4.7-23), 64-bit
postgres=# create user "firstname.lastname";
CREATE ROLE
postgres=# grant connect on database my_test_db to "firstname.lastname";
GRANT
postgres=# \q

From server staging.mycompany.com I can connect to the database using user
firstname.lastname successfully.
[root(at)staging] # psql -h localhost -U firstname.lastname -d my_test_db
my_test_db=>

But I want to setup JumpCloud or LDAP or any other authentication so that I
can connect PostgreSQL user "firstname.lastname" directly from my Macbook
Pro Terminal using my JumpCloud Password. Like:-

/Users/firstname.lastname > psql -h staging.mycompany.com -U
firstname.lastname -d my_test_db
Password for user firstname.lastname: < I have Not given any password when
I created PostgreSQL user firstname.lastname above and trying to
authenticate here using my JumpCloud password, May be the same way as I
could connect above to root. But when I enter my JumpCloud Password here
there is an error. >
psql: error: could not connect to server: FATAL: password authentication
failed for user "firstname.lastname"

What more to set up so that I can connect PostgreSQL (9.6.17) database
using PostgreSQL user ( with the Same name as of my JumpCloud/ Macbook Pro
user) directly from my Macbook Pro terminal using my JumpCloud Password
authentication?
What do I need to set up in pg_hba.conf ?
Please suggest in detail.
Thks

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Adrian Klaver 2020-07-16 19:55:20 Re: Fwd: How to connect PostgreSQL (9.6.17) database from Macbook Pro Terminal using JumpCloud password?
Previous Message Holger Jakobs 2020-07-15 17:37:07 Re: Cross-site cookies warnings

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-07-16 19:55:20 Re: Fwd: How to connect PostgreSQL (9.6.17) database from Macbook Pro Terminal using JumpCloud password?
Previous Message Tiffany Thang 2020-07-16 17:41:56 Capturing just slow queries

Browse pgsql-novice by date

  From Date Subject
Next Message Adrian Klaver 2020-07-16 19:55:20 Re: Fwd: How to connect PostgreSQL (9.6.17) database from Macbook Pro Terminal using JumpCloud password?
Previous Message Devraj B 2020-07-15 03:42:20 How to connect PostgreSQL (9.6.17) database from Macbook Pro Terminal using JumpCloud password?