Skip to main content
changed the typography a bit
Source Link

Background

Background

I have a BananaPi with Bananian, Apache2 and OwnCloud. Plugged into the Banana Pi is a NTFS-formatted HDD that gets mounted via ntfs-3g. I created five users on the system and there is a .NTFS-3G/UserMapping file inside the base-directory of the mounted partition, resulting in a UID/GID/SID mapping of the users and in automatically setting the permissions and acl options when the partition gets mounted. (www-data is not included in the UserMapping-file.) This partition contains a directory shares for Samba-shares and a directory owncloud/data. The owner of the whole owncloud-tree is root:root and permissions are 777.

Problem

Problem

In order for apache to access the data and owncloud to work, the owncloud/data directory has to belong to www-data:www-data. But if I try this:

chown -R www-data:www-data /media/hdd/owncloud/data

chown -R www-data:www-data /media/hdd/owncloud/data 

the ownership gets set to root:root, whatever owner the files and folders had before. This also happens for a single file:

chown www-data:www-data /media/hdd/owncloud/data/owncloud.log

chown www-data:www-data /media/hdd/owncloud/data/owncloud.log 

and for every other place on the HDD:

chown -R www-data:www-data /media/hdd/shares/maximilian

chown -R www-data:www-data /media/hdd/shares/maximilian 

But if I set the ownership to an arbitrary user, for example:

chown -R maximilian:maximilian /media/hdd/owncloud/data

chown -R maximilian:maximilian /media/hdd/owncloud/data 

it works perfectly fine!

Why can't I set the ownership to www-data then?

Background

I have a BananaPi with Bananian, Apache2 and OwnCloud. Plugged into the Banana Pi is a NTFS-formatted HDD that gets mounted via ntfs-3g. I created five users on the system and there is a .NTFS-3G/UserMapping file inside the base-directory of the mounted partition, resulting in a UID/GID/SID mapping of the users and in automatically setting the permissions and acl options when the partition gets mounted. (www-data is not included in the UserMapping-file.) This partition contains a directory shares for Samba-shares and a directory owncloud/data. The owner of the whole owncloud-tree is root:root and permissions are 777.

Problem

In order for apache to access the data and owncloud to work, the owncloud/data directory has to belong to www-data:www-data. But if I try this:

chown -R www-data:www-data /media/hdd/owncloud/data

the ownership gets set to root:root, whatever owner the files and folders had before. This also happens for a single file:

chown www-data:www-data /media/hdd/owncloud/data/owncloud.log

and for every other place on the HDD:

chown -R www-data:www-data /media/hdd/shares/maximilian

But if I set the ownership to an arbitrary user, for example:

chown -R maximilian:maximilian /media/hdd/owncloud/data

it works perfectly fine!

Why can't I set the ownership to www-data then?

Background

I have a BananaPi with Bananian, Apache2 and OwnCloud. Plugged into the Banana Pi is a NTFS-formatted HDD that gets mounted via ntfs-3g. I created five users on the system and there is a .NTFS-3G/UserMapping file inside the base-directory of the mounted partition, resulting in a UID/GID/SID mapping of the users and in automatically setting the permissions and acl options when the partition gets mounted. (www-data is not included in the UserMapping-file.) This partition contains a directory shares for Samba-shares and a directory owncloud/data. The owner of the whole owncloud-tree is root:root and permissions are 777.

Problem

In order for apache to access the data and owncloud to work, the owncloud/data directory has to belong to www-data:www-data. But if I try this:

chown -R www-data:www-data /media/hdd/owncloud/data 

the ownership gets set to root:root, whatever owner the files and folders had before. This also happens for a single file:

chown www-data:www-data /media/hdd/owncloud/data/owncloud.log 

and for every other place on the HDD:

chown -R www-data:www-data /media/hdd/shares/maximilian 

But if I set the ownership to an arbitrary user, for example:

chown -R maximilian:maximilian /media/hdd/owncloud/data 

it works perfectly fine!

Why can't I set the ownership to www-data then?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266
fix a typo
Link
Thomas Dickey
  • 79.3k
  • 9
  • 189
  • 290

chmod chown -R www-data:www-data sets ownership to root

added 102 characters in body
Source Link
S818
  • 121
  • 1
  • 1
  • 4
Loading
Source Link
S818
  • 121
  • 1
  • 1
  • 4
Loading