Use a different user to "w" to copy or move zip file to a mounted folder.
Then use chmod and chown to set file privileges and set owner "d" and group
"b".

For the above tasks use phpssh2

http://php.net/manual/en/book.ssh2.php
El 31/07/2015 6:05, "dev" <[email protected]> escribió:

> Hello everyone and thanks a lot for reading :)
>
>
> *Main goal:*
> Php script run with user w moves a zip from my server to a mounted folder.
> Users can connect via ftp with the user b and access and delete the file.
>
> I would like to know why it doesn't work and what the best way is and
> which dangers I have to keep in mind.
>
> *Main problem*
> Depending on the rights I can not delete the file as *b* or not move the
> file to the destination as *w*
>
> *Users and Groups involved are:*
> *w : w*
> *b : b*
> *s : s*
>
> *Config1:*
> Allows b to view and delete zip's but doesn't allow w to move files.
>
> *The user s is used to mound the /data folder:*
> cat /proc/mounts | grep *s:s* returns:
> *s:s* /data fuse.glusterfs
> rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072
> 0 0
>
> *File System rights:*
> /data/backend/    drwxr-xr-x 4 *root b* (parent folder)
> /data/backend/is/ drwxrwxr-x 2 *b* *w  *(folder containing the zip's)
> (also doesn't work with 777)
> *Zip files:*
> xxx.zip -rwxrwxr-x 1 *b w*
>
>
>
> *Config2:*
> Allows w to move and b to view but b can't delete the files now.
>
> *The user s is used to mound the /data folder:*
> cat /proc/mounts | grep *s:s* returns:
> *s:s* /data fuse.glusterfs
> rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072
> 0 0
>
> *File System rights:*
> /data/backend/    drwxr-xr-x 4 *root b* (parent folder)
> /data/backend/is/ drwxrwxr-x 2 *w* *b  *(folder containing the zip's)
> (also doesn't work with 777)
> *Zip files:*
> xxx.zip -rw-r--r-- 1 *w w  --> a chmod 777 is executed --> *xxx.zip -rwxrwxrwx
> 1 *w w --> chown b:b --> **Operation not permitted*
>
>
> *Additonal info*
> Command to test operations: sudo -u (w or b)
> Server runs Ubuntu 14.04
>
>
>
>
>
> --
> --
> You received this message because you are subscribed to the Linux Users
> Group.
> To post a message, send email to [email protected]
> To unsubscribe, send email to [email protected]
> For more options, visit our group at
> http://groups.google.com/group/linuxusersgroup
> References can be found at: http://goo.gl/anqri
> Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules
> or http://cdn.fsdev.net/List-Rules.pdf)
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Linux Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules or 
http://cdn.fsdev.net/List-Rules.pdf)

--- 
You received this message because you are subscribed to the Google Groups 
"Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to