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

前端 未结 6 2731
长情又很酷
长情又很酷 2021-02-20 02:37

I believe I ended up mixing up permissions at /etc/ssl directories tree as the last modification was made on 18th November and a day after I could not get my PostgreSQL to work.

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-20 03:08

    I am running the postgres server in WSL, and I was facing the error with the ssl-cert file. I managed to make it work by changing the owner of the file to the postgres user I had created, adding the expected user and group IDs to the user as required of the application (111 and 116, respectively, as gleaned from helpful error messages), and voila, I have an active server from within WSL.

    sudo useradd postgres
    sudo usermod -u 111 -g 116 -a -G ssl-cert postgres
    sudo chown postgres /etc/ssl/private/ssl-cert-snakeoil.key
    

    After running the above, there were two more files the user running the server (postgres for me) needed permission to access, both residing in /var/postgresql. I used sudo chown -- twice more to give ownership to postgres. Running sudo service postgresql start will tell you which files you'll need to transfer ownership of through any error messages.

提交回复
热议问题