LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Granting full write access to another users web directory (https://www.linuxquestions.org/questions/linux-server-73/granting-full-write-access-to-another-users-web-directory-704270/)

acctman 02-12-2009 04:38 PM

Granting full write access to another users web directory
 
i have two web areas /home/area1/public_html/ this holds the main site and php files, and /home/userimgs/public_html/ all the user images are held here. my problem is i dont have permission to unlink files from "userimg" from "area1"...

how do I sent full access write permission for user area1 to delete files on userimgs? FTP is not an open i'd like to look into, its just not stable enough to handle massive amounts of files passing through every few second with requiring a restart. what would be the proper way to do this with group and user write access

tenko20xx 02-12-2009 05:58 PM

Hmmm... assuming all the files and folders under /home/userimgs are owned by userimgs and userimgs has a group called userimgs you should be able to put the user area1 in the group userimgs like so:

Code:

$ sudo usermod -a -G userimgs area1
Of course, I believe you'll have to have root access to do that. If it all works out you then just have to make sure that the files you are wanting to unlink have group write permissions, something like 664. For example:

Code:

$ ls -l
total 4
-rw-r--r-- 1 userimgs userimgs 1583 2009-02-12 16:52 image.jpg
$ sudo chmod 664 *.jpg
[enter your password]:
$ ls -l
total 4
-rw-rw-r-- 1 userimgs userimgs 1583 2009-02-12 16:52 image.jpg

Let me know if I'm being unclear or if you need any additional help. I'm still new to explaining how I accomplish Linux tasks to people.

acctman 02-12-2009 06:32 PM

i sold the issue with this...

groupadd userimggrp

(for lack of a better name, "userimggrp" lol.)

usermod -a -G userimggrp username
usermod -a -G userimggrp someotheruser

chown -R userimgs:userimggrp /home/userimgs/

(That would make the user userimgs the owner, and the group userimggrp the owning group.)

Then you would want to chmod it so that the owners would have full access.

chmod -R ug+rw /home/userimgs/

(Or ug+rwx is you plan on executing files under that path.)


All times are GMT -5. The time now is 05:02 AM.