How can I configure PostgreSQL to use Windows Authentication?

后端 未结 2 1956
走了就别回头了
走了就别回头了 2021-02-05 07:35

I am trying to setup PostgreSQL and allow only certain Windows users to access the data from the database. Setting up Windows Authentication is Quite easy with MS SQL, but I can

2条回答
  •  悲&欢浪女
    2021-02-05 08:15

    Is the Postgresql server running on Windows as well as the clients then you might test with this to see if this works:

    host all all 0.0.0.0/0 sspi
    

    Magnus Hagander, a Postgresql developer, elaborates on this:

    "All users connecting from the local machine, your domain, or a trusted domain will be automatically authenticated using the SSPI configured authentication (you can enable/disable things like NTLMv2 or LM using Group Policy - it's a Windows configuration, not a PostgreSQL one). You still need to create the login role in PostgreSQL, but that's it. Note that the domain is not verified at all, only the username. So the user Administrator in your primary and a trusted domain will be considered the same user if they try to connect to PostgreSQL. Note that this method is not compatible with Unix clients."

    If you mix Unix-Windows then you have to resort to kerberos using GSSAPI which means you have to do some configuration. This article on deploying Pg in Windows environments may perhaps lead you in the right path.

提交回复
热议问题