×


"Login disallowed for security reasons" phppgadmin error – Fix it Now ?

"Login disallowed for security reasons" phppgadmin error happens when there is an Extra login security enabled in the phpPgAdmin configuration.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related phpPgAdmin queries.

In this context, we shall look into how to resolve this phppgadmin error.


What triggers phpPgAdmin error "Login disallowed for security reasons" ?

Recently we received a request that the customer is receiving the error as shown below while accessing PostgreSQL via phpPgAdmin:

Login disallowed for security reasons.

The users were getting redirected to the login page with the above message. This generally happens when we enable extra login security in the phpPgAdmin configuration file. 


How to resolve phpPgAdmin error "Login disallowed for security reasons"?

Basically, this error happens mainly when we enable the extra login security. Thus to fix this error, we turn this parameter to false in the configuration file.

1. First, we need to open the config.inc.php on /etc/phppgadmin with any text editor. 

2. Then, change the $conf['extra_login_security'] = true; to false.

If extra login security is true, it denies then logins via phpPgAdmin with no password or certain usernames (pgsql, Postgres, root, administrator). Thus, by default the value is true.

3. Now that we have changed the extra login security settings, we need to restart the PostgreSQL using the command below for the changes to take effect.

$ sudo systemctl restart postgresql

4. Finally, we also need to restart the apache service with the command below

$ sudo systemctl restart apache2


How to fix phpPgAdmin error "Login disallowed for security reasons" on Plesk Servers ?

On a Plesk for Linux server, accessing the PostgreSQL server from Tools & Settings > Database Servers fails with the same error.

To fix the error:

1. We need to open the file /usr/local/psa/admin/htdocs/domains/databases/phpPgAdmin/conf/config.inc.php

2. Then, we need to disable the option $conf['extra_login_security'] by turning it to false.

3. Finally, we need to restart the PostgreSQL service with the command below:

$ service postgresql restart


[Need urgent assistance with fixing PostgreSQL errors? – We're available 24*7. ]


Conclusion

This article covers how to resolve "Login disallowed for security reasons" phppgadmin error. Basically, the "Login disallowed for security reasons" error can happen when extra login security is enabled in the phpPgAdmin configuration file.


To fix this issue, You will need to edit the phppgadmin config file from following directory /etc/phppgadmin/config.inc.php.

Finally modify the line $conf['extra_login_security'] = true; to $conf['extra_login_security'] = false;