Missing permissions for www-data in /var/www/owncloud/core

Hi,

i´m not able to import ssl certs. It seems www-data has not enough permissions.
Can somebody help me with this issue?

Must www-data have permissions in /var/www/owncloud/core?

Sorry for my bad english!

Thank you for help!

Owncloud Version. 10.4.1
Debian : 10
Webserver: Apache

root@OBG-SRV048:/var/www/owncloud/certs# sudo -u www-data /var/www/owncloud/occ security:certificates:import /var/www/owncloud/certs/cert.pem

In Certificate.php line 62:

Certificate could not get parsed.

security:certificates:import

Insert your ownCloud log here

{“reqId”:“CgEE00keckEfo2zrzn4B”,“level”:3,“time”:“2020-07-03T07:31:17+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"–",“url”:"–",“message”:“file_get_contents(/var/www/owncloud/certs/cert.pem): failed to open stream: Permission denied at /var/www/owncloud/core/Command/Security/ImportCertificate.php#59”}

Permissions:
root@OBG-SRV048:/var/www/owncloud# ls -ltr
insgesamt 384
-rw-r–r-- 1 root root 2231 Apr 15 13:37 status.php
-rw-r–r-- 1 root root 26 Apr 15 13:37 robots.txt
-rw-r–r-- 1 root root 5618 Apr 15 13:37 remote.php
-rw-r–r-- 1 root root 2157 Apr 15 13:37 README.md
-rw-r–r-- 1 root root 3135 Apr 15 13:37 public.php
-rwxr-xr-x 1 root root 283 Apr 15 13:37 occ
-rw-r–r-- 1 root root 3524 Apr 15 13:37 index.php
-rw-r–r-- 1 root root 179 Apr 15 13:37 index.html
-rw-r–r-- 1 root root 31204 Apr 15 13:37 db_structure.xml
-rw-r–r-- 1 root root 1717 Apr 15 13:37 cron.php
-rw-r–r-- 1 root root 34520 Apr 15 13:37 COPYING
-rw-r–r-- 1 root root 4624 Apr 15 13:37 console.php
-rw-r–r-- 1 root root 200376 Apr 15 13:37 CHANGELOG.md
-rw-r–r-- 1 root root 8859 Apr 15 13:37 AUTHORS
-rw-r–r-- 1 root root 280 Apr 15 13:37 version.php
drwxr-xr-x 2 root root 4096 Apr 24 22:23 etc
drwxr-xr-x 2 www-data www-data 4096 Apr 24 22:23 assets
drwxr-xr-x 4 root root 4096 Apr 29 08:08 resources
drwxr-xr-x 16 root root 4096 Apr 29 08:08 core
drwxr-xr-x 6 root root 4096 Apr 29 08:08 lib
drwxr-xr-x 2 root root 4096 Apr 29 08:08 ocs-provider
drwxr-xr-x 2 root root 4096 Apr 29 08:08 ocs
drwxr-xr-x 2 root root 4096 Apr 29 08:08 ocm-provider
drwxr-xr-x 6 root root 4096 Apr 29 08:08 updater
drwxr-xr-x 12 root root 4096 Apr 29 08:08 settings
drwxr-xr-x 3 www-data www-data 4096 Apr 29 08:26 apps-external
drwxr-xr-x 23 www-data www-data 4096 Jul 1 07:21 apps
drwxrwx— 11 www-data www-data 4096 Jul 2 08:50 data
drwxrwxr-x 2 www-data www-data 4096 Jul 2 13:35 config

Hi Tom,

at a first glance it looks the cert file itself doesn’t have the right permissions.

Execute this command
sudo chown www-data /var/www/owncloud/certs/cert.pem
and retry the import.

You don’t have to touch other permissions, they look fine.

2 Likes