Ubuntu: How to delete/edit files created by other user? [duplicate]



Question:

This question already has an answer here:

I asked client to create a sub-domain and a folder for me.

He created a sub-domain and dir ygjhazaxnv

I only have SSH access as mani user.

I put files in ygjhazaxnv folder via Git pull and the owner of all these files is mani. So far all OK.

Now the project I configured is able to create files dynamically, whatever the files are created by my project(PHP files) has owner ygjhazaxnv

Now how can I delete files created by ygjhazaxnv user when logged in as mani?

I tried to own those files via chown but error chown: changing ownership of ‘ABC’: Operation not permitted

Both ygjhazaxnv and root user lies under group www-data

Server is Amazon EC2


Solution:1

Ask the client to add mani to the group named www-data and give write permissions to that group for the whole folder.


Solution:2

You might also consider setting the umask for both users to 002 instead of the default (022). This will ensure files created by both users have group writable access.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »