nEMESIS4
11-21-2001, 09:40 AM
What would be a good way to allow FTP access to just TWO directories on a RAQ4i? Any ideas?
For examples, the user logs in through FTP and ONLY has access to these two directories...
/home/sites/site1/web/images
/home/sites/site1/web/html
Chicken
11-22-2001, 03:55 AM
Create a symbolic link from their user directory to the site folders (you may also have to chown the site folders to the respective user as well).
nEMESIS4
11-23-2001, 09:29 AM
I've tried that, but maybe I'm doing something wrong. I'll explain step by step what I've done.
1) Created two users for that domain in the control panel, both do NOT have site admin access.
2) Through telnet I placed symlinks in both of the users directories.
-----------------
ln -s /home/sites/site1/web/data1 /home/sites/site1/users/user1
ln -s /home/sites/site1/web/data2 /home/sites/site1/users/user2
-----------------
(The above is supposed to give user1 access to data1 through ftp, and user2 to data2)
3) Through telnet when I CD as root the symlinks work fine, and go to the proper directories. But when I log in through FTP using user1 or user2 the symlink shows, but when I double click on it, it says 'Invalid Directory'.
I've tested it with 3 different FTP clients, with all the available symlink display options in them.
Any idea why it's not working?
technoart
11-24-2001, 05:14 AM
If the "DefaultRoot" directive is used in the proftpd config file (which it is by default on the RaQs) the users are jailed into their *home* directories (and cannot chdir into a higher level directory).
A reading from the Gospel of ProFTPD... ;)
The DefaultRoot directive is implemented using the chroot(2) system call.
Symlinks will not work from within a chrooted area. The reason should be clear from a casual inspection of the nature of the chroot command. It is not possible to have a symbolic link to a directory which can't be reached because it's outside of the current chroot.
CmptrWz
11-24-2001, 10:17 AM
Why not put the actual folders in the directories the user can access and use symbolic links from the main dir to the user's dir?
technoart
11-24-2001, 06:23 PM
I don't know the specific needs of the two users sharing the same dir, but in general, here's what I'd do, if I needed to provide this 2-on-a-ftp-space requirement:
Create a 3rd-level domain, e.g. twousers.my-domain.com
Limit the # of users to TWO.
Give both the users ADMIN rights (within the 3rd-level domain)
They both then would have control over the /home/sites/site-whatever/ dir
nEMESIS4
12-05-2001, 09:34 AM
Originally posted by CmptrWz
Why not put the actual folders in the directories the user can access and use symbolic links from the main dir to the user's dir?
Thanks for the posts, I would like to try the suggest method above. I've been playing around with symlinks but just can't seem to figure it out. This is what I want to accomlish.
www.domain1.com/test should display everything that is in...
www.domain1.com/~username/images
I made the syslink in /home/sites/site1/web directory, and tried changing the ownership to both the username, and the site administer. But neither worked.
I was able to get the symlinks to do the following,
www.domain1.com/test displays www.domain1.com/images
Basically what should I do to make a symlink in the main root directory, that points to the user root directory. Thanks.
nEMESIS4
12-05-2001, 10:03 AM
Basically I want:
/home/sites/site1/web/images
(www.domain.com/images)
to VIEW:
/home/sites/site1/users/username/web/images
(www.domain.com/~username/images)
This is so the user can only have access to one directory via ftp, but it's viewable from the web at www.domain.com/images
nEMESIS4
12-12-2001, 09:18 AM
Anybody have any ideas? Any help would be very much appricated, thanks.
cactus
12-12-2001, 10:51 AM
Hi,
Include this line in your etc/proftpd.conf the following:
DefaultRoot ~ !admin
This will allow admin user to 'roam' to anywhere on the site but your normal users that you create will be limited to their home directories.