login to postgres as another user gives FATAL error

Atrotors

I have a postgres server and I don't want django to login as postgres user, so I created a user called django with createuser --interactive -P django.

I want to login as django over ssh but when I try psql -U django -W it gives me this error:

psql: FATAL:  Peer authentication failed for user "django"
Blackus

You have to authorize your new user to connect to database by editing your pg_hba.conf file (often located on /etc/postgresql/9.4/main/pg_hba.conf with 9.4 being your installed version of PostgreSQL).

Do to so, add a line on it like this one :

# TYPE  DATABASE        USER            ADDRESS                 METHOD
local   django          django                                  trust

Supposing that you created a database name django for your django user. It only allow your user to connect locally, if you want to allows him to connect via TCP/IP, line is more like

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    django          django          192.168.12.10/32        md5

Where 192.168.12.10 is the IP from where your django user will reach your database.

Read comments on pg_hba.conf file, they explain pretty well how it works. Or have a look at this documentation on PostgreSQL website.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

login to postgres as another user gives FATAL error

From Dev

New Symfony2 User Class gives Fatal Error

From Dev

if else gives fatal error

From Dev

django application on heroku gives 'Programming error at /admin/login "auth_user" does not exist.' on login

From Dev

PostgreSQL: MD5 Authentication in pg_hba.conf gives me FATAL: Peer authentication failed for user "postgres"

From Dev

postgres : Password login error

From Dev

Smarty gives Fatal error on editing .tpl file

From Dev

molden install gives fatal compilation error

From Dev

FATAL: password authentication failed for user "postgres"

From Dev

Cannot login to 'postgres' database as 'postgres' user

From Dev

User login password error

From Dev

magento backend unable to login Fatal error getBlockName

From Dev

login/register system getting fatal error php

From Dev

FATAL EXCEPTION in Google login (Fantom error)

From Dev

findViewById() in another class gives error

From Dev

ssh gives an illegal user error

From Dev

Twitter kit gives error despite successful login

From Dev

NodeJS - Passport gives me 404 Error on login

From Java

docker-compose not starting postgres and gives error

From Dev

Test authenticate postgres user without login

From Dev

Test authenticate postgres user without login

From Dev

Git Clone from another server - Fatal error

From Dev

cimport gives fatal error: 'numpy/arrayobject.h' file not found

From Dev

PHP Amazon Ses as an abstract class gives use fatal error

From Dev

Chef gives fatal error when running killall in bash

From Dev

Codecept installation gives me an fatal error (bz2 extension)

From Dev

Fatal error: Call to a member function user() on boolean

From Dev

php-login.net MVC login script gives a 500 error

From Java

FATAL: password authentication failed for user "postgres" (postgresql 11 with pgAdmin 4)

Related Related

  1. 1

    login to postgres as another user gives FATAL error

  2. 2

    New Symfony2 User Class gives Fatal Error

  3. 3

    if else gives fatal error

  4. 4

    django application on heroku gives 'Programming error at /admin/login "auth_user" does not exist.' on login

  5. 5

    PostgreSQL: MD5 Authentication in pg_hba.conf gives me FATAL: Peer authentication failed for user "postgres"

  6. 6

    postgres : Password login error

  7. 7

    Smarty gives Fatal error on editing .tpl file

  8. 8

    molden install gives fatal compilation error

  9. 9

    FATAL: password authentication failed for user "postgres"

  10. 10

    Cannot login to 'postgres' database as 'postgres' user

  11. 11

    User login password error

  12. 12

    magento backend unable to login Fatal error getBlockName

  13. 13

    login/register system getting fatal error php

  14. 14

    FATAL EXCEPTION in Google login (Fantom error)

  15. 15

    findViewById() in another class gives error

  16. 16

    ssh gives an illegal user error

  17. 17

    Twitter kit gives error despite successful login

  18. 18

    NodeJS - Passport gives me 404 Error on login

  19. 19

    docker-compose not starting postgres and gives error

  20. 20

    Test authenticate postgres user without login

  21. 21

    Test authenticate postgres user without login

  22. 22

    Git Clone from another server - Fatal error

  23. 23

    cimport gives fatal error: 'numpy/arrayobject.h' file not found

  24. 24

    PHP Amazon Ses as an abstract class gives use fatal error

  25. 25

    Chef gives fatal error when running killall in bash

  26. 26

    Codecept installation gives me an fatal error (bz2 extension)

  27. 27

    Fatal error: Call to a member function user() on boolean

  28. 28

    php-login.net MVC login script gives a 500 error

  29. 29

    FATAL: password authentication failed for user "postgres" (postgresql 11 with pgAdmin 4)

HotTag

Archive