1

I have a constraint, that I can use only one user on a SUSE Linux Enterprise Server 11.

Now, I need to install PostgreSQL. Is it possible to somehow avoid the automatic creation of "postgres" linux user by PostgreSQL's installation wizard, and use current user as a database admin?

Additional explanation about the weird constraints:

We have to host our software on the server of the IT company, which is subsidiary of the big bank. They have quite strict rules, due to storing and processing of the sensitive user data. So, one of the rules, is that we can have only one user there and everything should be installed under this user (with sudo rights). Initially, the server has only the most basic software (and PostgreSQL is not included there).

Docker is not an alternative in this case.

3

I think your requirements seem to be interpreted by somebody quite incompetent.

I would argue that a user is a person and for each of person that will need to have admin access to the database server you need a personal user account, as shared accounts are evil ; you need to be able to hold individual people accountable for their actions.

Services don't belong to a single person but run from service account and service accounts such as the postgres account, are IMHO not the same as user accounts. For starters accounts for people are part of the security process that revokes access for leavers and inactive users...
You don't want to delete the payroll database when Alice from HR who installed it leaves the company, right?

When you don't want to use the stock RPM packages from SuSe for postgres (which will also create the postgres service account) please create your own and provide those to the IT department, rather than doing a manual install.

That way your database administrator user accounts won't need excessive permissions to run an installer, you won't need a big footprint with compilers and build-tools installed on (production) servers, you have a clear list of dependancies and the package can create the necessary service account (or use an existing) and set up all permissions in a way that is much more easy to repeat and audit than running installer scripts.

Create a suitable sudo profile for the people that will manage the Posgres database server and allow administrators to run the limited subset of commands that a Postgres admin would need to run as the postgres user, i.e. psql, service postgres [stop|start|restart], pg*

But to answer your actual question:

How avoid the automatic creation of "postgres" linux user by PostgreSQL's installation wizard?

Don't run the wizard, but build from source, use the correct options to select an installation directory accessible to the user running the build and no other user accounts or elevated privileges are needed.

./configure --prefix=/path/to/dir [--other-options]
make
make install
  • Thank you for thorough explanation. Also, the proposed solution solves the problem. – Bi0max Sep 7 '18 at 7:48
0

According to the short version of the installation manual, you have to manually create a user when installing from sources, then su to the user account and start PostgreSQL. Just skip these steps and you'll run the server as your own local user account.

If you install the package provided by SUSE, you can manually delete the user account that it created and change the configuration files which start the daemon at boot time to not use that user account but yours. Unfortunately I don't have SUSE Linux running so I can't provide you with the details for that.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.