0

I am using a postgres docker image configured with the following environment:

    image: healthcheck/postgres:alpine
    environment:
      POSTGRES_USER: postgres

I have the following questions regarding this setup:

  • What is the default user of postgresql?
  • How does hardcoding the postgres user improve security?
  • What special rights does the postgres user have?
  • What is the upside and downside of using an unprivileged user ?
  • @Zeitounator merci !! – omar amine May 2 at 12:52
1

What is the default user of postgresql?

postgres

How does hardcoding the postgres user improve security?

It's not using the root user.

You can use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage.

What special rights does the postgres user have?

Not many.

It installs itself a hole through the local firewall but, otherwise, it's just another user.

What is the upside and downside of using an unprivileged user ?

You should never run applications (or databases) as root (unless they actually need to be).

Always keep the biggest and best tools in the toolbox for yourself, ready to sort out the mess that Applications (or Users) make. If you run stuff as root and it decides to do something really stupid to your machine, you may not be able to fix it.

  • It's not using the root user. You can use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage. What do you mean here with "consistency is a Wonderful Thing" ? – omar amine May 5 at 19:55
  • Quite simply, when you get called into a "mess" at 2am, you don't want to guessing about /anything/, not even which user account the Postgres cluster is installed under. If they're all the same? No guessing required. Same goes for the file system layout you use when you build each machine - data goes /here/, transaction logs go /there/, archived WAL files go /there/; again, no guesswork. – Phill W. May 8 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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