Su: Permission denied

Hi every one
I am trying to install the system on Centos 7 server using the VNC viewer. everything goes well except the PostgreSQL part it says su: Permission denied. some messages below:

Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service to /usr/lib/systemd/system/postgresql-9.4.service.
POSTGRESQL SERVICE: Active: active (running) since Wed 2018-08-01 11:44:07 SAST; 10ms ago
Password: su: Permission denied
Executing SQL script: ./database/01-extensions/pgcrypto.sql
Password: su: Permission denied
Executing SQL script: ./database/01-extensions/postgis.sql
Password: su: Permission denied
Executing SQL script: ./database/02-types/01.t_data_type.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/02.config_category.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/03.site.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/04.config.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/05.config_metadata.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/06.config_job.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/07.processor.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/08.module.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/09.job_start_type.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/105.satellite.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/106.downloader_history.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/107.downloader_status.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/10.activity_status.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/111.scheduled_tasks.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/112.datasource.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/113.downloader_count.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/11.job.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/12.task.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/13.step.sql
Password: su: Permission denied
Executing SQL script: ./database/03-tables/14.product_type.sql
Password: su: Permission denied

I went through some readings and I checked the password files I did find the username I am using listed. I found instead the “vncuser”

Please any help???

Hi. This is strange. I suppose you were running sudo ./update.sh, right?

Can you try running sudo su - postgres -c 'psql sen2agri' from the same account?

This issue is resolved according to Nicola help via email correspondance
#########################################
Hi Khaled,
There were a lot of differences between your folder and one from a clean CentOS install, but ultimately it seems the issue is in /etc/pam.d/su.
You have to edit that file and add a hash sign at the start of the first line:
— su 2018-08-02 18:10:34.000000000 +0300
+++ /etc/pam.d/su 2018-07-19 11:58:23.000000000 +0300
@@ -1,14 +1,9 @@
-%PAM-1.0
+#%PAM-1.0
The line in cause was invalid, and made PAM stop processing the file. Because of this, any authentication attempt using su was failing.
Hope this helps,
Laurentiu
################################################################
Sure, you can post that the solution was to change that line, however it’s likely that the file was edited by someone with root/sudo access on that machine. So I don’t think anyone else will encounter the same issue as you did.