32

I am configuring my centos server. I installed postgresql and phppgadmin

When i try accessing phppgadmin as my_server_ip/phpPgAdmin

It redirects to login page and when i try to login getting error as

Login disallowed for security reasons

I even change extra_login_security to false and restarted using following commands

/etc/init.d/httpd restart

and

service postgresql-9.2 restart

Can anyone help me.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
Prabhakaran
  • 3,900
  • 15
  • 46
  • 113

3 Answers3

83

1). Open -> /etc/phppgadmin -> config.inc.php

2). change $conf['extra_login_security'] = true; to $conf['extra_login_security'] = false;

// If extra login security is true, then logins via phpPgAdmin with no // password or certain usernames (pgsql, postgres, root, administrator) // will be denied. Only set this false once you have read the FAQ and // understand how to change PostgreSQL's pg_hba.conf to enable // passworded local connections.

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Emu
  • 5,763
  • 3
  • 31
  • 51
  • 2
    Fixed for me while integrating postgres and phppgadmin with wamp on windows. – Craig van Tonder Dec 13 '14 at 12:07
  • 5
    Why would one expect to not be able to login to phppgadmin right after installing it? Seems counter intuitive? – Ruraj Nov 19 '15 at 04:30
  • @Ruraj using this only certain usernames (pgsql, postgres, root, administrator) will be denied. or usernames without any password – Ahmad Mushtaq Oct 04 '20 at 09:01
  • Could be that you have to restart postgresql and apache2 before this applies. Not sure though, I could not test it. https://bobcares.com/blog/login-disallowed-for-security-reasons-phppgadmin-error-how-we-fix-it/. In my case, even that did not help, there was no reaction at any pw entry. I could not get access to my definitely running server that I had built according to https://www.howtoforge.com/tutorial/ubuntu-postgresql-installation/, I guess Phppgadmin is replaced by Adminer and the trick does not work anymore? – questionto42 Jul 27 '21 at 20:49
4

I had this exact same problem - also on CentOS - and also had no luck changing that security setting to false.

It turned out that it's not using the config file we expected.


It's using: /usr/share/phpPgAdmin/conf/config.inc.php

and not: /etc/phpPgAdmin/config.inc.php


even though the RPM (phpPgAdmin-5.1-1.rhel6.noarch) installs both of them...

I really don't see why it has two unless there is an override defined somewhere... but I don't really have time to look into it. I'm sure there is no reason why you can't replace the one in /etc with a symlink (or hardlink) to the other, although it could cause problems if you try to uninstall the RPM. But I wouldn't unless you were dead keen to have it in /etc - just in case. I'm sure they didn't include two of these just for fun ;)

I know this is probably too late to help you but the fact I came across this today means it's likely to be of use to someone :)

-1

You need to restart the postgresql

systemctl restart postgresql

systemctl restart apache2

guest
  • 11