postgresql: FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied

Hi there,

As I use this recipe to install postgresql, I run into this error:

FATAL:  could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied

I have tried all the recommended solutions to solve it, including changing the owner and group of the key to postgres. Nothing works. To verify that it doesn’t work even with that, I ran the following command on the key:

sudo -u postgres cat  ssl-cert-snakeoil.key

The result was:

cat: ssl-cert-snakeoil.key: Permission denied

(I am running Ubuntu 14.04 with Vagrant. Using passenger/ruby-20 image and Docker as provider.)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 23

Commits related to this issue

Most upvoted comments

hmm, in my case, solution was to add postgres to ssl-cert group. Not quite sure this was the right thing to do, but it did work.

gpasswd -a postgres ssl-cert

was the missing ssl-cert group for the postgres user here on debian (usermod postgres -g ssl-cert)

As far as I know users that wants to access files in /etc/ssl/private/ needs to be in the group ssl-cert on Ubuntu systems. Have you checked that?