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

前端 未结 6 2658
长情又很酷
长情又很酷 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:16

    Only thing that will work if you have changed permissions for /etc/ssl/private

    mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
    

    Copy this whole command (It's a one line code).

    If this doesn't work for you, ckeck your postgres user groups by groups postgres and make sure your postgres user have ssl-cert root postgres (Order doesn't matter).

    Now lets check your file permissions on ssl/private :

    $ ls -la /etc/ssl/
    > drwx------   2 postgres root private
    

    If this is not the output change your permissions with sudo chmod -R 700 /etc/ssl/private and for owners chown -R postgres:root /etc/ssl/private

    //Now check permissions on ssl-cert-snakeoil.key, 
    //which will be inside your **private** directory.
    $ ls -la /etc/ssl/private/ssl-cert-snakeoil.key
    > -rwx------ 1 postgres root /etc/ssl/private/ssl-cert-snakeoil.key
    

提交回复
热议问题