Skip to main content
Revised for PostgreSQL 9.5.
Source Link
Derek Mahar
  • 28.5k
  • 46
  • 128
  • 182

You should definitely read the section on "Client Authentication"19.1 Client Authentication in the PostgreSQL manualPostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.confpg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manualversion 9.5 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they likewish, without the need for a password or any other authentication. See Section 19.3.1 for details.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group, for example a reject line could block a specific host from connecting, while a later line allows the remaining hosts in a specific network to connect.

md5

Require the client to supply an MD5a double-encryptedMD5-hashed password for authentication. See Section 19.3.2 for details.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks. See Section 19.3.2 for details.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections. See Section 19.3.3 for details.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user See Section 19. This is only available3.4 for TCP/IP connections details.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident ident server on the client, and check if it matches the requested database user name. Ident authentication can only be used on TCP/IP connections. When specified for local connections, peer authentication connections by getting it fromwill be used instead. See Section 19.3.5 for details.

peer

Obtain the client's operating system) user name from the operating system and check if it matches matches the requested database user name. This is only available for local connections. See Section 19.3.6 for details.

ldap

Authenticate using an LDAP server. See Section 19.3.7 for details.

radius

Authenticate using a RADIUS server. See Section 19.3.8 for details.

cert

Authenticate using SSL client certificates. See Section 19.3.9 for details.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system. See Section 19.3.10 for details.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection records you have defined in there.

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant themdo one of the corresponding access privileges, depending on your needs.following:

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

  1. Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection records you have defined in there.

  2. Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

  3. Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection records you have defined in there.

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

You should definitely read section 19.1 Client Authentication in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 9.5 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they wish, without the need for a password or any other authentication. See Section 19.3.1 for details.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group, for example a reject line could block a specific host from connecting, while a later line allows the remaining hosts in a specific network to connect.

md5

Require the client to supply a double-MD5-hashed password for authentication. See Section 19.3.2 for details.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks. See Section 19.3.2 for details.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections. See Section 19.3.3 for details.

sspi

Use SSPI to authenticate the user. This is only available on Windows. See Section 19.3.4 for details.

ident

Obtain the operating system user name of the client by contacting the ident server on the client and check if it matches the requested database user name. Ident authentication can only be used on TCP/IP connections. When specified for local connections, peer authentication will be used instead. See Section 19.3.5 for details.

peer

Obtain the client's operating system user name from the operating system and check if it matches the requested database user name. This is only available for local connections. See Section 19.3.6 for details.

ldap

Authenticate using an LDAP server. See Section 19.3.7 for details.

radius

Authenticate using a RADIUS server. See Section 19.3.8 for details.

cert

Authenticate using SSL client certificates. See Section 19.3.9 for details.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system. See Section 19.3.10 for details.

So ... to solve the problem you're experiencing, you could do one of the following:

  1. Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection records you have defined in there.

  2. Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

  3. Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

Updated for better readability.
Source Link
Leo Bedrosian
  • 3.8k
  • 2
  • 21
  • 22

You're getting this error because you're failing client authentication. Based on the error message, you probably have the default postgres configuration, which sets client authentication method to "IDENT" for all PostgreSQL connections.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.confpg_hba.conf file to trusttrust, md5md5, or passwordpassword (depending on your security and simplicity needs) for the local connection record(s)records you have defined in there.

b) Update pg_ident.confpg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

Note: The location of pg_hba.confpg_hba.conf and pg_ident.confpg_ident.conf is OS dependent.

You're getting this error because you're failing client authentication. Based on the error message, you probably have the default postgres configuration, which sets client authentication method to "IDENT" for all PostgreSQL connections.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection record(s) you have defined in there.

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

Note: The location of pg_hba.conf and pg_ident.conf is OS dependent.

You're getting this error because you're failing client authentication. Based on the error message, you probably have the default postgres configuration, which sets client authentication method to "IDENT" for all PostgreSQL connections.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection records you have defined in there.

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

Note: The location of pg_hba.conf and pg_ident.conf is OS dependent.

Added additional information about potential configuration options.
Source Link
Leo Bedrosian
  • 3.8k
  • 2
  • 21
  • 22

You're getting this error because you're failing client authentication. Based on the error message, you probably have the default postgres configuration, which sets client authentication method to "IDENT" for all PostgreSQL connections.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection record(s) you have defined in there.

OR

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

Note: The location of pg_hba.conf and pg_ident.conf is OS dependent.

You're getting this error because you're failing client authentication. Based on the error message, you probably have the default postgres configuration, which sets client authentication method to "IDENT" for all PostgreSQL connections.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection record(s) you have defined in there.

OR

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

Note: The location of pg_hba.conf and pg_ident.conf is OS dependent.

You're getting this error because you're failing client authentication. Based on the error message, you probably have the default postgres configuration, which sets client authentication method to "IDENT" for all PostgreSQL connections.

You should definitely read the section on "Client Authentication" in the PostgreSQL manual to better understand the authentication settings available (for each record in pg_hba.conf), but here is the relevant snippet to help with the problem you're having (from the version 8.4 manual):

trust

Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.

reject

Reject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.

md5

Require the client to supply an MD5-encrypted password for authentication.

password

Require the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.

gss

Use GSSAPI to authenticate the user. This is only available for TCP/IP connections.

sspi

Use SSPI to authenticate the user. This is only available on Windows.

krb5

Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.

ident

Obtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.

ldap

Authenticate using an LDAP server.

cert

Authenticate using SSL client certificates.

pam

Authenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

So ... to solve the problem you're experiencing, you could either:

a) Change the authentication method(s) defined in your pg_hba.conf file to trust, md5, or password (depending on your security and simplicity needs) for the local connection record(s) you have defined in there.

b) Update pg_ident.conf to map your operating system users to PostgreSQL users and grant them the corresponding access privileges, depending on your needs.

c) Leave the IDENT settings alone and create users in your database for each operating system user that you want to grant access to. If a user is already authenticated by the OS and logged in, PostgreSQL won't require further authentication and will grant access to that user based on whatever privileges (roles) are assigned to it in the database. This is the default configuration.

Note: The location of pg_hba.conf and pg_ident.conf is OS dependent.

Source Link
Leo Bedrosian
  • 3.8k
  • 2
  • 21
  • 22
Loading