Обсуждение: Deactivate/disable User id in Postgres

Поиск
Список
Период
Сортировка

Deactivate/disable User id in Postgres

От
Rajin Raj
Дата:
Hi,

Is there any option to deactivate/disable a user id in Postgres?
I can think of below two options, 

ALTER USER <user_id> WITH CONNECTION LIMIT 0;
ALTER USER <user_id> WITH NOLOGIN

Is there any better approach? 

Regards,
Rajin 

Re: Deactivate/disable User id in Postgres

От
John Scalia
Дата:
Setting the role for NOLOGIN is probably your best route. You could also revoke their privileges on any database object, if you were especially concerned.
Jay

Sent from my iPad

On May 4, 2020, at 7:30 AM, Rajin Raj <rajin.raj@opsveda.com> wrote:


Hi,

Is there any option to deactivate/disable a user id in Postgres?
I can think of below two options, 

ALTER USER <user_id> WITH CONNECTION LIMIT 0;
ALTER USER <user_id> WITH NOLOGIN

Is there any better approach? 

Regards,
Rajin 

Re: Deactivate/disable User id in Postgres

От
Rui DeSousa
Дата:


On May 4, 2020, at 7:29 AM, Rajin Raj <rajin.raj@opsveda.com> wrote:

Hi,

Is there any option to deactivate/disable a user id in Postgres?
I can think of below two options, 

ALTER USER <user_id> WITH CONNECTION LIMIT 0;
ALTER USER <user_id> WITH NOLOGIN

Is there any better approach? 

Regards,
Rajin 

Using external authentication is an option too. i.e. using LDAP; disabling the account in LDAP means the user cannot login.

Re: Deactivate/disable User id in Postgres

От
Ron
Дата:
On 5/4/20 9:45 AM, Rui DeSousa wrote:


On May 4, 2020, at 7:29 AM, Rajin Raj <rajin.raj@opsveda.com> wrote:

Hi,

Is there any option to deactivate/disable a user id in Postgres?
I can think of below two options, 

ALTER USER <user_id> WITH CONNECTION LIMIT 0;
ALTER USER <user_id> WITH NOLOGIN

Is there any better approach? 

Regards,
Rajin 

Using external authentication is an option too. i.e. using LDAP; disabling the account in LDAP means the user cannot login.

That would be a disaster in an enterprise that has many systems, and uses LDAP/AD for account management.

--
Angular momentum makes the world go 'round.

Re: Deactivate/disable User id in Postgres

От
Ron
Дата:
What about setting the password expiration to "now"?  That also would prevent the user from logging in.

On 5/4/20 6:50 AM, John Scalia wrote:
Setting the role for NOLOGIN is probably your best route. You could also revoke their privileges on any database object, if you were especially concerned.
Jay

Sent from my iPad

On May 4, 2020, at 7:30 AM, Rajin Raj <rajin.raj@opsveda.com> wrote:


Hi,

Is there any option to deactivate/disable a user id in Postgres?
I can think of below two options, 

ALTER USER <user_id> WITH CONNECTION LIMIT 0;
ALTER USER <user_id> WITH NOLOGIN

Is there any better approach? 

Regards,
Rajin 

--
Angular momentum makes the world go 'round.

Re: Deactivate/disable User id in Postgres

От
Holger Jakobs
Дата:
Won't help if authentication doesn't use passwords.

Am 10. Mai 2020 14:26:35 MESZ schrieb Ron <ronljohnsonjr@gmail.com>:
What about setting the password expiration to "now"?  That also would prevent the user from logging in.

On 5/4/20 6:50 AM, John Scalia wrote:
Setting the role for NOLOGIN is probably your best route. You could also revoke their privileges on any database object, if you were especially concerned.
Jay

Sent from my iPad

On May 4, 2020, at 7:30 AM, Rajin Raj <rajin.raj@opsveda.com> wrote:


Hi,

Is there any option to deactivate/disable a user id in Postgres?
I can think of below two options, 

ALTER USER <user_id> WITH CONNECTION LIMIT 0;
ALTER USER <user_id> WITH NOLOGIN

Is there any better approach? 

Regards,
Rajin 

--
Angular momentum makes the world go 'round.

--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

Re: Deactivate/disable User id in Postgres

От
Rui DeSousa
Дата:

> On May 10, 2020, at 8:24 AM, Ron <ronljohnsonjr@gmail.com> wrote:
>
> On 5/4/20 9:45 AM, Rui DeSousa wrote:
>>
>>
>> Using external authentication is an option too. i.e. using LDAP; disabling the account in LDAP means the user cannot
login.
>
> That would be a disaster in an enterprise that has many systems, and uses LDAP/AD for account management.
>
> --
> Angular momentum makes the world go ‘round.

Hmm, enterprises do exactly that and once the account is disabled its disabled everywhere.  Single sign-on is very
commonpractice these days.  I would agree if talking about a targeted specific system temporarily.  


Re: Deactivate/disable User id in Postgres

От
Scott Ribe
Дата:
> On May 10, 2020, at 8:45 AM, Rui DeSousa <rui@crazybean.net> wrote:
>
> I would agree if talking about a targeted specific system temporarily.

Even then, of course you manage it with LDAP. By removing the user from the group that grants access to the db rather
thandeactivating the user. Really, it's the whole point of LDAP...