ftp configuration

Hello experts,
             I have a doubt regarding ftp. I installed and setup vsftpd on linux. I want to configure such a way that have 3 users A,B and C. They have home directories. Have a folder in / named A and inside it two folders B and C. A can ftp access to A,B and C. But B and C have access to their own B and C folder only. How to setup ftp access like this. Thanks in advance.
Who is Participating?
I guess you could create  your direcotries  and chamge the home folders of A,B and C.

/A would be the home folder of A
/A/B home folder of user B
/A/C home folder of user C
that way, A  have an access to to B and C stuff.

Open vsftpd configuration file - /etc/vsftpd/vsftpd.conf
check the option : chroot_local_user=YES

If you are settingup the ftp share in windows then it is similar as providing sharing and security permissions for A on A,B,C folders and B 's access to folder B and C's access to folder C.
jacobbbcAuthor Commented:
@Gpramodkumar: my os is linux....
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

The usual setup is to chroot ftp users to their home directories. For security reasons, this is highly recommended.

If you want users to be able to access files somewhere else in the directory tree, the trick I know of is to mount these folders with the '-bind' command. The trick is described here:

In your case, you would have to create 3 different mountpoints, one for each ftp user, and you would also have to add them to the /etc/fstab file.
jacobbbcAuthor Commented:
@torimar: Is it not possible without mounting?
jacobbbcAuthor Commented:
@maxalarie: The folder A is not user A's home folder.
>> "@torimar: Is it not possible without mounting?"

There are three conceivable ways of dealing with this issue:

1. Not to chroot your users and give them access to the complete filesystem:-> a security disaster, impossible.
2. To set the user's home folders to be identical with their FTP root folders, as suggested by maxalarie above:-> not practical for you.
3. The mount/bind trick.

I personally do not know of any other way, and an online research did not yield one either.
Have you tested the mount/bind trick? It means just typing one line in the terminal. If you find it working, it means only three more lines in the fstab. That's less work to do than in many other configuration tasks on Linux...
change user's home directory.
#usermod -d /A a
#usermod -d /A/B b
#usermod -d /A/C c

For changing the user home directory in to a specified path ,need to modify in vsftpd.conf file & add the below line to end of  vsftpd.conf file.




Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.