Here are my steps:
mkdir /mnt/docs
chown www-data:www-data /mnt/docs
ls -l /mnt
Positive results:
drwxr-xr-x 2 www-data www-data 4096 Jan 6 01:14 docs
drwxr-xr-x 2 root root 4096 Dec 8 21:46 cdrom
Now I mount the remote share successfully (I can touch
files to it as root) like so
mount -t cifs //192.168.1.10/Public/Documents/Docs -o username=****,password="****" /mnt/docs
ls -l /mnt
Negative results (the owner is back to root):
drwxr-xr-x 2 root root 0 Jan 12 02:51 docs
drwxr-xr-x 2 root root 4096 Dec 8 21:46 cdrom
I then tried to chown
the symlink like so (with -h)
chown -h www-data:www-data /mnt/docs
ls -l /mnt
But the results are still
drwxr-xr-x 2 root root 0 Jan 12 02:51 docs
drwxr-xr-x 2 root root 4096 Dec 8 21:46 cdrom
How can I mount the share to a local mount point as a non-root user? The goal is to let Apache be able to write to the remote share. Solutions for either Debian or CentOS systems are appreciated. Also, chmod
as no effect either.
Related: Symbolic link creation failing: change ownership issue