Data directory is readable by other use

Ask all your questions regarding OC 8.0 and 8.1 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
iruindegi
Newbie
Posts: 3
Joined: Fri Sep 18, 2015 11:16 am
PHP version: PHP 5.6.13-0+deb8u1

Data directory is readable by other use

Postby iruindegi » Tue Sep 22, 2015 3:05 pm

Hi,
I have owncloud installed on debian 8 and this is my config.php:

Code: Select all

# cat /var/www/owncloud/config/config.php
<?php
$CONFIG = array (
  'instanceid' => 'ID',
  'passwordsalt' => 'PASSWD_SALT',
  'secret' => 'SECRET',
  'trusted_domains' =>
  array (
    0 => '192.168.1.210',
    1 => 'MYDOMAIN.com',
    2 => 'www.MYDOMAIN.com',
  ),
  'datadirectory' => '/mnt/owncloud/data',
  'overwrite.cli.url' => 'http://www.MYDOMAIN.com/owncloud',
  'dbtype' => 'mysql',
  'version' => '8.1.3.0',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'DBUSER',
  'dbpassword' => 'DBPASSWD',
  'logtimezone' => 'UTC',
  'installed' => true,
  'theme' => '',
  'maintenance' => false,
  'memcache.local' => '\OC\Memcache\APC',
);


I have a Synology Nas (Really it´s a XPEnology) with a sharedfolder that I mounted via CIFS on fstab like this:

Code: Select all

//192.168.1.200/owncloud /mnt/owncloud cifs credentials=/home/USER/.cloudcredentials,iocharset=utf8,sec=ntlm,file_mode=0770,dir_mode=0770,noperm 0 0


The drive is mounted correctly and I can see the data from my NAS (owncloud files).
After that I change the ownership and give permission like this:

Code: Select all

chown -R www-data:www-data /mnt/owncloud
chmod -R 770 /mnt/owncloud
/etc/init.d/apache2 restart


This is the output for the ls command:

Code: Select all

# ls -la /mnt/
total 8
drwxr-xr-x  3 root     root     4096 Sep 18 11:33 .
drwxr-xr-x 22 root     root     4096 Sep 10 10:22 ..
drwxrwxrwx  5 www-data www-data    0 Sep 18 11:07 owncloud


Code: Select all

# ls -la /mnt/owncloud
total 12
drwxrwxrwx 5 www-data www-data    0 Sep 18 11:07 .
drwxr-xr-x 3 root     root     4096 Sep 18 11:33 ..
drwxrwxrwx 5 www-data www-data    0 Sep 18 11:35 data
drwxrwxrwx 4 www-data www-data    0 Sep 17 20:54 USER
-rwxrwxrwx 1 www-data www-data    0 Sep 17 13:29 index.html
-rwxrwxrwx 1 www-data www-data 1024 Sep 13 21:19 owncloud.db
-rwxrwxrwx 1 www-data www-data 6362 Sep 17 20:54 owncloud.log


Code: Select all

# ls -la /mnt/owncloud/data
total 3
drwxrwxrwx 5 www-data www-data    0 Sep 18 11:35 .
drwxrwxrwx 5 www-data www-data    0 Sep 18 11:07 ..
drwxrwxrwx 2 www-data www-data    0 Sep 18 11:35 .locks
drwxrwxrwx 2 www-data www-data    0 Sep 18 11:07 .ocdata
drwxrwxrwx 4 www-data www-data    0 Sep 18 11:35 USER
-rwxrwxrwx 1 www-data www-data    0 Sep 18 11:35 index.html
-rwxrwxrwx 1 www-data www-data 1024 Sep 18 11:35 owncloud.db
-rwxrwxrwx 1 www-data www-data 1621 Sep 18 11:35 owncloud.log



The fact is that if I open the owncloud url http://www.MYDOMAIN.com/owncloud I got an error:

Code: Select all

Data directory (/mnt/owncloud/data) is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.


Any help?

UPDATED: I wrote chmod -R 777 but I mean chmod -R 770
Last edited by iruindegi on Tue Sep 22, 2015 3:46 pm, edited 1 time in total.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Data directory is readable by other use

Postby RealRancor » Tue Sep 22, 2015 3:37 pm

Hi,

in your posted ls output you can see that the permissions are indeed 777 and not 770 as suggested. Thats the first point you need to fix to resolve this issue.
*gone*

iruindegi
Newbie
Posts: 3
Joined: Fri Sep 18, 2015 11:16 am
PHP version: PHP 5.6.13-0+deb8u1

Re: Data directory is readable by other use

Postby iruindegi » Tue Sep 22, 2015 3:44 pm

yap sorry, the above code should be

Code: Select all

chmod -R 770 /mnt/owncloud


it´s wthat I executed, but same problem

I updated my first post

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Data directory is readable by other use

Postby RealRancor » Tue Sep 22, 2015 3:58 pm

Hi,

you shouldn't execute chmod commands on non-linux external commands as stated here (little bit hidden) in the notes box:

https://doc.owncloud.org/server/8.1/adm ... ermissions

Better see why your mount / fstab entry is not providing the correct permissions.
*gone*

iruindegi
Newbie
Posts: 3
Joined: Fri Sep 18, 2015 11:16 am
PHP version: PHP 5.6.13-0+deb8u1

Re: Data directory is readable by other use

Postby iruindegi » Tue Sep 22, 2015 4:18 pm

RealRancor wrote:Hi,

you shouldn't execute chmod commands on non-linux external commands as stated here (little bit hidden) in the notes box:

https://doc.owncloud.org/server/8.1/adm ... ermissions

Better see why your mount / fstab entry is not providing the correct permissions.


that was the reason! CIFS mounted drive... I fixed with this on fstab:

Code: Select all

//192.168.1.200/owncloud /mnt/owncloud cifs user,uid=33,gid=33,rw,suid,credentials=/home/ikerib/.cloudcredentials,iocharset=utf8,sec=ntlm,file_mode=0770,dir_mode=0770,nounix 0 0


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.0 and 8.1”

Who is online

Users browsing this forum: No registered users and 1 guest