Linux – Restrict FTP account access down to several directories

debiandebian-squeezeftplinux

Is there any way, to restrict access to SSH and FTP account down to only several directories.

For example on our VPS we have some paths like:

@project root/proj1
@project root/proj2
@project root/proj3

And i want that user1 could access all three, user2 only second and user3 only first and second. Moreover is there any way to show to users only directories allowed to access?

I mean, if for example there are such directorys as:

/var/www/project
/var/www/project2
/var/www/project3

And user might go only to project and project2, but not to project3. So he could access /var/www, but not /var.

P.S. We have DirectAdminand Debian Squeeze.

Best Answer

You can do this by making symlinks to the real locations in each users' home directory, and restricting FTP access to the home directory only.

ProFTPd can do this, among others.