Setting a Users Home Folder


#1

I am using the PHP scripts of Coppermine for an online photogallery and would like to create another user account that only has access to the /photos directory of my domain. Is this possible? The folder needs to be accessible by my parent user account ( so that the PHP scripts work ) but any other way would be great.

Thanks,
Joe


#2

Totally possible!

Create the new user under the Users tab of the Panel, then go to the Domains tab, and his “Re-map Sub Dir”. You can specify any subdirectory of any domain name (aka: a virtual directory) to go anywhere.

WebID: idorosen Donate.


#3

But if I remap nittanynights.com/photos/albums/userpics (under my ‘nn’ account) to newaccount/userpics (under the ‘newaccount’ account) the coppermine PHP scripts that need to run and manipulate those images will not have the proper access. The PHP scripts from coppermine are running under the ‘nn’ account and do more than just resize the images in that subdir, but in this case they specifically create new sized images and thumbnails for use in the gallery at nittanynights.com/photos.

I’m sorry if that was a bit confusing. I really want to know if there is any way I can set up a user group with two users that have the same access on one directory. I read somewhere that the best way to do this is to have 3 users: one main user that has all the data, and the other two as child users that access specific areas of that. In my case, I only want to create one child user that access a specific folder of the parents home directory, but both need read/write access to it.

The virtual directory still will only allow one user to read/write to that area.

Thanks for your speedy reply,
Joe


#4

I understand now.

Yes. You need to create a group with both users in it. Then, ssh in, and use the “chgrp” command on the file as follows:

$ chgrp groupname filename
If filename = a directory:
$ chgrp -R groupname filename

Now “chmod” (change permissions" on the file) so that the group has read and write access:
$ cd photos
$ find . -type d | xargs chmod g+rwx
$ find . -type f | xargs chmod g+rw

(The above shell commands may seem a bit complicated, but use “man find” and “man xargs” to understand what each do.)

Ido
(WebID: idorosen. Donate!)